Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add adapter based on sharded Pub/Sub
Reference: https://redis.io/docs/manual/pubsub/#sharded-pubsub Usage: ```js import { Server } from 'socket.io'; import { createClient } from 'redis'; import { createShardedAdapter } from '@socket.io/redis-adapter'; const pubClient = createClient({ host: 'localhost', port: 6379 }); const subClient = pubClient.duplicate(); await Promise.all([ pubClient.connect(), subClient.connect() ]); const io = new Server({ adapter: createShardedAdapter(pubClient, subClient) }); io.listen(3000); ``` Related: #491
- Loading branch information
1 parent
1c99cab
commit e70b1bd
Showing
12 changed files
with
1,217 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
version: '2.0' | ||
services: | ||
redis: | ||
image: redis:5 | ||
image: redis:7 | ||
ports: | ||
- "6379:6379" |
Oops, something went wrong.