Last active
March 16, 2023 01:48
-
-
Save tito/e2cf588a0583462694f3 to your computer and use it in GitHub Desktop.
Redis pubsub viewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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