Last active
October 11, 2015 21:57
-
-
Save mreiferson/3925081 to your computer and use it in GitHub Desktop.
Example Synchronous Python Reader
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 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