Skip to content

Instantly share code, notes, and snippets.

@tito
Last active March 16, 2023 01:48
Show Gist options
  • Save tito/e2cf588a0583462694f3 to your computer and use it in GitHub Desktop.
Save tito/e2cf588a0583462694f3 to your computer and use it in GitHub Desktop.
Redis pubsub viewer
import redis
import sys
host = sys.argv[1]
room = sys.argv[2]
print "-- connect to redis"
client = redis.Redis(host=host)
pubsub = client.pubsub()
pubsub.subscribe(room)
print "-- listen to {}".format(room)
for item in pubsub.listen():
print item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment