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:
Damien Arrachequesne
2024-02-20 16:21:50 +01:00
parent 0e23ff0cc6
commit 1011ab3bfb

View File

@@ -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);
}