From 5e295bc39bb03c770422cb43e788507d8bc50f27 Mon Sep 17 00:00:00 2001 From: Dr Date: Tue, 9 Apr 2024 18:30:01 +0800 Subject: [PATCH] feat: SERVER_SIDE_EMIT support publishOnSpecificResponseChannel related: https://github.com/socketio/socket.io-redis-adapter/issues/407 --- lib/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/index.ts b/lib/index.ts index 57a0f62..64d82b2 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -412,8 +412,11 @@ export class RedisAdapter extends Adapter { } called = true; debug("calling acknowledgement with %j", arg); + const responseChannel = this.publishOnSpecificResponseChannel + ? `${this.responseChannel}${request.uid}#` + : this.responseChannel; this.pubClient.publish( - this.responseChannel, + responseChannel, JSON.stringify({ type: RequestType.SERVER_SIDE_EMIT, requestId: request.requestId,