"using the same redis.createclient() instance for publish and subscribe" Code Answer

11

From the Redis docs:

Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE and PUNSUBSCRIBE commands.

For this reason, you'll need two clients, one for subscribing and one for publishing (and potentially other commands).

By stealthyninja on May 6 2022

Answers related to “using the same redis.createclient() instance for publish and subscribe”

Only authorized users can answer the Search term. Please sign in first, or register a free account.