Alfred Balle
Alfred Balle

Reputation: 1195

python redis and command PUBSUB channels

I'm testing redis-py: https://github.com/andymccurdy/redis-py.

I have a hard time figuring out how to call and get output for the redis command PUBSUB channels.

Upvotes: 0

Views: 2221

Answers (1)

dizzyf
dizzyf

Reputation: 3693

To get all channels:

chans = r.pubsub_channels()

To get the number of subscribers to a channel:

num = r.pubsub_numsub('channel')

Upvotes: 4

Related Questions