mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-09 15:08:12 -05:00
refactor(cluster): allow to call onMessage() with a cluster response
The Redis adapter is currently the only adapter which makes a distinction between publishing messages (one channel for all) and responses (one channel for each node).
This commit is contained in:
@@ -299,6 +299,19 @@ export abstract class ClusterAdapter extends Adapter {
|
||||
break;
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
case MessageType.BROADCAST_CLIENT_COUNT:
|
||||
// @ts-ignore
|
||||
case MessageType.BROADCAST_ACK:
|
||||
// @ts-ignore
|
||||
case MessageType.FETCH_SOCKETS_RESPONSE:
|
||||
// @ts-ignore
|
||||
case MessageType.SERVER_SIDE_EMIT_RESPONSE:
|
||||
// extending classes may not make a distinction between a ClusterMessage and a ClusterResponse payload and may
|
||||
// always call the onMessage() method
|
||||
this.onResponse(message);
|
||||
break;
|
||||
|
||||
default:
|
||||
debug("unknown message type: %s", message.type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user