npm socket.io-redis 6.0.0

latest releases: 6.1.1, 6.1.0, 6.0.1...
3 years ago

⚠️ This release is only compatible with Socket.IO v3. For Socket.IO v2, please use previous versions.

See also: https://github.com/socketio/socket.io-redis#compatibility-table

Features

  • add support for Socket.IO v3 (d9bcb19)

BREAKING CHANGES:

  • all the requests (for inter-node communication) now return a Promise instead of accepting a callback

Before:

io.of('/').adapter.allRooms((err, rooms) => {
  console.log(rooms); // an array containing all rooms (across every node)
});

After:

const rooms = await io.of('/').adapter.allRooms();
console.log(rooms); // a Set containing all rooms (across every node)
  • RedisAdapter.clients() is renamed to RedisAdapter.sockets()

See socketio/socket.io-adapter@130f28a

  • RedisAdapter.clientRooms() is removed

It has been replaced by the fetchSockets() method in Socket.IO v4:

const sockets = await io.in(theSocketId).fetchSockets();
if (sockets.length) {
  console.log(sockets[0].rooms);
}
  • RedisAdapter.customHook() and RedisAdapter.customRequest() are removed

Those methods will be replaced by a more intuitive API in a future iteration.

  • support for Node.js 8 is dropped

See https://github.com/nodejs/Release

Links

Don't miss a new socket.io-redis release

NewReleases is sending notifications on new releases.