Skip to content

Documentation / @super-line/adapter-redis / createRedisAdapter

Function: createRedisAdapter() ​

createRedisAdapter(options?): Adapter

Defined in: index.ts:138

Create a Redis Pub/Sub Adapter for multi-node fan-out. Pass the same URL to every server process so rooms, topics, and the cluster event bus reach clients and server subscribers on any node. Uses two connections (a subscriber connection can't run other commands); at-most-once delivery, matching the library's model.

Parameters ​

options? ​

string | RedisAdapterOptions

a redis:// URL string or RedisAdapterOptions.

Returns ​

Adapter

Example ​

ts
createSuperLineServer(api, { server, adapter: createRedisAdapter('redis://localhost:6379') })

Released under the MIT License.