Skip to content

Commit

Permalink
refactor(cluster): allow to call onMessage() with a cluster response
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
darrachequesne committed Feb 20, 2024
1 parent 0e23ff0 commit 1011ab3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/cluster-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1011ab3

Please sign in to comment.