haredis icon indicating copy to clipboard operation
haredis copied to clipboard

Does haredis support psubscribe / pmessage?

Open vladminsky opened this issue 11 years ago • 1 comments

Hi,

I didn't find an explicit reference in documentation on the topic so decided to post you an issue.

It looks like haredis doesn't support psubscribe / on("pmessage") mechanism.

Here is a sample:


var redis = require('haredis');
var channelClient = redis.createClient('XX.XX.XX.XX:YYYY');
channelClient.debug_mode = true;

channelClient.on('message', console.log.bind(console, 'message:'));
channelClient.on('pmessage', console.log.bind(console, 'pmessage:'));

channelClient.subscribe('sample', function (err) {});
channelClient.psubscribe('*', function (err) {});

setInterval(channelClient.publish.bind(channelClient, 'sample', 1), 3000);

Result is:

message: sample 1
message: sample 1
. . .
message: sample 1
. . .

When it is running only subscribe / message approach is executed while subscribe by pattern doesn't look work at all.

I apologize in advance in case I missed something or use the lib incorrectly.

Thank you!

vladminsky avatar Mar 10 '14 16:03 vladminsky

Ah! I've been having this same issue. I'm glad it's not just me.

codebudo avatar Jun 25 '14 18:06 codebudo