|
1 | 1 | # History
|
2 | 2 |
|
| 3 | +- [8.2.0](820-2023-05-02) (May 2023) |
3 | 4 | - [8.1.0](810-2023-02-08) (Feb 2023)
|
4 | 5 | - [8.0.1](801-2023-01-11) (Jan 2023)
|
5 | 6 | - [**8.0.0**](#800-2022-12-07) (Dec 2022)
|
|
19 | 20 |
|
20 | 21 | # Release notes
|
21 | 22 |
|
| 23 | +## [8.2.0](https://github.com/socketio/socket.io-redis-adapter/compare/8.1.0...8.2.0) (2023-05-02) |
| 24 | + |
| 25 | + |
| 26 | +### Bug Fixes |
| 27 | + |
| 28 | +* cleanup error handler to prevent memory leak ([#490](https://github.com/socketio/socket.io-redis-adapter/issues/490)) ([b5da02d](https://github.com/socketio/socket.io-redis-adapter/commit/b5da02d779490f73c6c041999d10be1c98494f84)) |
| 29 | + |
| 30 | + |
| 31 | +### Features |
| 32 | + |
| 33 | +#### Sharded Pub/Sub |
| 34 | + |
| 35 | +Sharded Pub/Sub was introduced in Redis 7.0 in order to help scaling the usage of Pub/Sub in cluster mode. |
| 36 | + |
| 37 | +Reference: https://redis.io/docs/manual/pubsub/#sharded-pubsub |
| 38 | + |
| 39 | +A dedicated adapter can be created with the `createShardedAdapter()` method: |
| 40 | + |
| 41 | +```js |
| 42 | +import { Server } from 'socket.io'; |
| 43 | +import { createClient } from 'redis'; |
| 44 | +import { createShardedAdapter } from '@socket.io/redis-adapter'; |
| 45 | + |
| 46 | +const pubClient = createClient({ host: 'localhost', port: 6379 }); |
| 47 | +const subClient = pubClient.duplicate(); |
| 48 | + |
| 49 | +await Promise.all([ |
| 50 | + pubClient.connect(), |
| 51 | + subClient.connect() |
| 52 | +]); |
| 53 | + |
| 54 | +const io = new Server({ |
| 55 | + adapter: createShardedAdapter(pubClient, subClient) |
| 56 | +}); |
| 57 | + |
| 58 | +io.listen(3000); |
| 59 | +``` |
| 60 | + |
| 61 | +Minimum requirements: |
| 62 | + |
| 63 | +- Redis 7.0 |
| 64 | +- [`[email protected]`](https://github.com/redis/node-redis/commit/3b1bad229674b421b2bc6424155b20d4d3e45bd1) |
| 65 | + |
| 66 | +Added in [e70b1bd](https://github.com/socketio/socket.io-redis-adapter/commit/e70b1bde105d88eaa43272ff094c5540981a66d3). |
| 67 | + |
| 68 | +#### Support for node-redis cluster |
| 69 | + |
| 70 | +The `redis` package now supports Redis cluster. |
| 71 | + |
| 72 | +Added in [77ef42c](https://github.com/socketio/socket.io-redis-adapter/commit/77ef42c95d1ab637c33e2f69af5e0f7a12072629). |
| 73 | + |
| 74 | +#### Subscription modes |
| 75 | + |
| 76 | +The `subscriptionMode` option allows to configure how many Redis Pub/Sub channels are used: |
| 77 | + |
| 78 | +- "static": 2 channels per namespace |
| 79 | + |
| 80 | +Useful when used with dynamic namespaces. |
| 81 | + |
| 82 | +- "dynamic": (2 + 1 per public room) channels per namespace |
| 83 | + |
| 84 | +The default value, useful when some rooms have a low number of clients (so only a few Socket.IO servers are notified). |
| 85 | + |
| 86 | +```js |
| 87 | +const io = new Server({ |
| 88 | + adapter: createShardedAdapter(pubClient, subClient, { |
| 89 | + subscriptionMode: "static" |
| 90 | + }) |
| 91 | +}); |
| 92 | +``` |
| 93 | + |
| 94 | +Added in [d3388bf](https://github.com/socketio/socket.io-redis-adapter/commit/d3388bf7b5b64ff6d2c25a874f4956273c8e3f58). |
| 95 | + |
| 96 | +### Credits |
| 97 | + |
| 98 | +Huge thanks to [@winchell](https://github.com/winchell) for helping! |
| 99 | + |
| 100 | + |
| 101 | + |
22 | 102 | ## [8.1.0](https://github.com/socketio/socket.io-redis-adapter/compare/8.0.1...8.1.0) (2023-02-08)
|
23 | 103 |
|
24 | 104 | The `socket.io-adapter` package was added to the list of `peerDependencies`, in order to fix sync issues with the version imported by the `socket.io` package (see [f07ff7b](https://github.com/socketio/socket.io-redis-adapter/commit/f07ff7bd33817ac14d8d87ba55225e7936469429)).
|
|
0 commit comments