7.1.0
Features
Error handling can now be done on the redis clients directly.
Before:
io.of("/").adapter.on("error", () => {
// ...
});
After:
pubClient.on("error", () => {
// something went wrong
});
subClient.on("error", () => {
// something went wrong
});
- send response to the requesting node only (f66de11)
A more performant way to do request-response is available behind an option, publishOnSpecificResponseChannel
:
const io = require('socket.io')(3000);
const { createClient } = require('redis');
const redisAdapter = require('@socket.io/redis-adapter');
const pubClient = createClient({ host: 'localhost', port: 6379 });
const subClient = pubClient.duplicate();
io.adapter(redisAdapter(pubClient, subClient, {
publishOnSpecificResponseChannel: true
}));
To upgrade an existing deployment, you will need to upgrade all nodes to the latest version with publishOnSpecificResponseChannel = false, and then toggle the option on each node.
Please check the commit for more information.
Links
- Diff: 7.0.1...7.1.0