h0x91b / redis-fast-driver

78 stars 13 forks source link

redis error Error: ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context #32

Closed sirganya closed 4 years ago

sirganya commented 4 years ago

I wanted to write a test to publish and subscribe to the same channel. What's the best way to get around this error?

h0x91b commented 4 years ago

You must use separate Redis clients, a subscription is a special mode, you can not use regular commands when a client in this mode...

check: https://github.com/h0x91b/redis-fast-driver/blob/master/example-pubsub.js