Skip to content

gaufung/RabbitmqAdapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

RabbitMQ's Tornado Advance APIs

1 Background

pika is a RabbitMQ client in Python and it also supports tornado's IOLoop connection. However, the APIs for asychronous method are very poor. So I extends the APIs for better asychronous support.

2 APIs

2.1 Publish

@gen.coroutine
def publish(self, exchange, routing_key, body, properties=None,  mandatory=True, return_callback=None, close_callback=None):
    pass

2.2 Consumer

@gen.coroutine
def receive(self, exchange, routing_key, queue_name, handler, no_ack=False, prefetch_count=0,return_callback=None, close_callback=None, cancel_callback=None):
    pass

2.3 RPC

@gen.coroutine
def rpc(self, exchange, routing_key, body, timeout, ttl, close_callback=None, return_callback=None, cancel_callback=None):
    pass

3 Conclusion

This library has widly used in production environment and is proved that it is bug free.

Releases

No releases published

Packages

No packages published

Languages