KombuPython 的消息库
Kombu 是一个为Python写的消息库。Kombu 旨在使消息通知在Python中更容易。
示例代码:
from kombu import Connection, Exchange, Queue media_exchange = Exchange('media', 'direct', durable=True) video_queue = Queue('video', exchange=media_exchange, routing_key='video') def process_media(body, message): print body message.ack() # connections with Connection('amqp://guest:guest@localhost//') as conn: # produce producer = conn.Producer(serializer='json') producer.publish({'name': '/tmp/lolcat1.avi', 'size': 1301013}, exchange=media_exchange, routing_key='video', declare=[video_queue]) # the declare above, makes sure the video queue is declared # so that the messages can be delivered. # It's a best practice in Kombu to have both publishers and # consumers declare the queue. You can also declare the # queue manually using: # video_queue(conn).declare() # consume with conn.Consumer(video_queue, callbacks=[process_media]) as consumer: # Process messages and handle events on all channels while True: conn.drain_events() # Consume from several queues on the same channel: video_queue = Queue('video', exchange=media_exchange, key='video') image_queue = Queue('image', exchange=media_exchange, key='image') with connection.Consumer([video_queue, image_queue], callbacks=[process_media]) as consumer: while True: connection.drain_events()
评论
snakeMQPython消息队列库
snakeMQ是一个跨平台的Python消息队列库。消息队列让不同主机间通信变得简单可靠。使用snakeMQ,只需要发送消息,剩下的事都交给snakeMQ处理。特色:纯python实现,跨平台自动重连
snakeMQPython消息队列库
0
TBHintViewiOS 消息提醒库
TBHintView是一个简单的、可高度定制的iOS信息提示开发包,可为任何UIView增加简单提示,支持多页以及显示和隐藏的动画效果。
TBHintViewiOS 消息提醒库
0
Pusher-jsJavaScript 消息推送库
Pusher-js 是 Pusher webservice 的 JavaScript 客户端,可利用
Pusher-jsJavaScript 消息推送库
0