h0x91b / redis-fast-driver

78 stars 13 forks source link

PUB/SUB not working as expected. #30

Closed tarangill closed 5 years ago

tarangill commented 5 years ago

When subscribed to a channel, no events are emitted when something is published on that channel. The subscriber does not get notified on a message.

Even in your pub/sub example, the subscriber just subscribes to a channel "Foo", and when the publisher publishes to channel "Foo", the subscriber does not get notified.

tarangill commented 5 years ago

Actually the callback of the Subscriber rawCall is called everytime somebody publishes a message to that channel. I don't know if that is the intended purpose, but it solves my issue.

h0x91b commented 5 years ago

Yes, it's by design, use your callback.

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