Last active
December 20, 2015 07:09
-
-
Save rickhanlonii/6091542 to your computer and use it in GitHub Desktop.
As posted on HN. Example of adding more queues/consumers to andreimarcu/aamnoifs.
This file contains 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 notifs | |
def print_notification(title, message): | |
print "Notification received: {0}: {1}".format(title, message) | |
def web_app_notify(title, message): | |
print "Webapp notification received: {0}: {1}".format(title, message) | |
def iphone_app_notify(title, message): | |
print "iPhone App notification received: {0}: {1}".format(title, message) | |
def android_app_notify(title, message): | |
print "Android App notification received: {0}: {1}".format(title, message) | |
try: | |
n = notifs.Notifs("amqps://user:[email protected]:5673/%2F") | |
n.receive("routing_name", print_notification) | |
n.receive("routing_name", web_app_notify) | |
n.receive("routing_name", iphone_app_notify) | |
n.receive("routing_name", android_app_notifify) | |
except KeyboardInterrupt: | |
break | |
# https://github.com/andreimarcu/aamnotifs | |
# https://news.ycombinator.com/item?id=6109977 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment