Asynchronous AMQP

Post on 16-Jul-2015

126 Views

Category:

Internet

6 Downloads

Preview:

Click to see full reader

Transcript

Async AMQPkombu + 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