diff --git a/lib/redis.client.ts b/lib/redis.client.ts index b988480..c3844c2 100644 --- a/lib/redis.client.ts +++ b/lib/redis.client.ts @@ -260,9 +260,10 @@ export class RedisStreamClient extends ClientProxy { // if BLOCK time ended, and results are null, listen again. if (!results) return this.listenOnStreams(); - const [key, messages] = results[0]; - - await this.notifyHandlers(key, messages); + for (let result of results) { + let [stream, messages] = result; + await this.notifyHandlers(stream, messages); + } return this.listenOnStreams(); } catch (error) { diff --git a/lib/redis.server.ts b/lib/redis.server.ts index 82f4f1a..6d3e254 100644 --- a/lib/redis.server.ts +++ b/lib/redis.server.ts @@ -268,9 +268,10 @@ export class RedisStreamStrategy // if BLOCK time ended, and results are null, listen again. if (!results) return this.listenOnStreams(); - const [key, messages] = results[0]; - - await this.notifyHandlers(key, messages); + for (let result of results) { + let [stream, messages] = result; + await this.notifyHandlers(stream, messages); + } return this.listenOnStreams(); } catch (error) {