Skip to content

Instantly share code, notes, and snippets.

@mreiferson
Last active October 11, 2015 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mreiferson/3925081 to your computer and use it in GitHub Desktop.
Save mreiferson/3925081 to your computer and use it in GitHub Desktop.
Example Synchronous Python Reader
import nsq
def task1(message):
print message
return True
def task2(message):
print message
return True
all_tasks = {"task1": task1, "task2": task2}
r = nsq.Reader(all_tasks, lookupd_http_addresses=['127.0.0.1:4161'],
topic="nsq_reader", channel="asdf")
nsq.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment