Skip to content

Instantly share code, notes, and snippets.

@dgtlmoon
dgtlmoon / RedisPythonPubSub1.py
Created October 8, 2016 19:26 — forked from jobliz/RedisPythonPubSub1.py
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)