Работаем с rabbitmq в python используя kombu + gevent. (rinat khabibiev)
Post on 08-May-2015
383 Views
Preview:
DESCRIPTION
TRANSCRIPT
Async AMQP kombu + gevent
https://github.com/renskiy/async_amqp
Table of contents
• requirements
• AMQP
• gevent + kombu
• solution
• useful links and questions
Queues are useful for
• process synchronization
• deferred computations
• slow I/O
Somewhere in the code
Requirements
• Python 2.x (2.5 or higher)
• gevent
• kombu
Advanced Message Queuing
Protocol
• Broker
• Message
• All messages are published into Exchange
• Client consumes messages from Queue
• Messages from Exchange are routed to Queue
based on condition specified by Binding
Exchange types
• direct - exact match of message’s Routing Key and
binding’s one
• topic - basic routing based on wildcard matching of
Routing Key treated as zero or more words separated
by «.» («*» - single word, «#» - zero or more words)
• fanout - simple broadcast
• headers - more complicated routing based on custom
headers matching
gevent + kombu
Publisher
Sync Consumer
Async Consumer
Semaphore Consumer
Useful links
• https://github.com/renskiy/async_amqp
• http://mutlix.blogspot.ru/2007/09/amqp-in-10-
mins-part0.html
• http://sdiehl.github.io/gevent-tutorial/
top related