@inkly/redis
v0.0.0
Published
Redis pub/sub plugin for inkly: horizontal scaling of rooms/events across nodes.
Readme
@inkly/redis
Redis pub/sub broadcast bridge for inkly room and app-wide events.
withBroadcast(app, pubsub) wraps the public app.emit() and app.to(room).emit() APIs. Local broadcasts are still delivered in-process, then a small JSON envelope is published to a broker channel. Other instances replay the envelope into their own local fan-out and ignore envelopes tagged with their own instance id.
The package does not open Redis connections. Inject publisher and subscriber clients with redisBroadcaster(), or provide any object implementing the minimal PubSub interface. Tests use an in-memory fake bus; no Redis server is required or exercised here.
See docs/overview.md and examples/scale-out.ts.
