Skip to content

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

Function: createRedisAdapter()

createRedisAdapter(options?): Adapter

Defined in: index.ts:136

Create a Redis Pub/Sub Adapter for multi-node fan-out. Pass the same URL to every server process so rooms, topics, and serverToServer events reach clients 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
createSocketServer(api, { server, adapter: createRedisAdapter('redis://localhost:6379') })

Released under the MIT License.