Skip to content

Instantly share code, notes, and snippets.

@andymccurdy
Created April 1, 2010 17:22
Show Gist options
  • Save andymccurdy/352095 to your computer and use it in GitHub Desktop.
Save andymccurdy/352095 to your computer and use it in GitHub Desktop.
import threading
import Queue
q = Queue.Queue()
def worker():
while True:
msg = q.get(block=True)
# do stuff with the message
t = threading.Thread(target=worker)
t.setDaemon(True)
t.start()
for msg in redis.listen():
q.put(msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment