pub/sub from redis-cli

240 views
Skip to first unread message

Chris Johnson

unread,
Oct 23, 2011, 5:50:21 PM10/23/11
to redi...@googlegroups.com
I am new to redis and playing with some of the features. One of the things I am curious about is the ability to subscribe to a stream from the cli. Problem is that there doesn't appear to be a way to unsubscribe from the cli.

When I subscribe I get the following and when I hit ctrl-c, it exits the cli completely.

redis 127.0.0.1:6379> SUBSCRIBE test
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "test"
3) (integer) 1

Is there a way to unsubscribe without killing the cli?

Thanks
Chris

Didier Spezia

unread,
Oct 25, 2011, 6:25:23 AM10/25/11
to redi...@googlegroups.com
Apparently, there is not:

        if (config.pubsub_mode) {
            if (!config.raw_output)
                printf("Reading messages... (press Ctrl-C to quit)\n");
            while (1) {
                if (cliReadReply(output_raw) != REDIS_OK) exit(1);
            }
        }

Regards,
Didier.
Reply all
Reply to author
Forward
0 new messages