https://github.com/gaufung/rabbitmqadapter
A Rabbitmq Adapter for Tornado
https://github.com/gaufung/rabbitmqadapter
asynchronous pika rabbitmq rabbitmq-client tornado
Last synced: 2 months ago
JSON representation
A Rabbitmq Adapter for Tornado
- Host: GitHub
- URL: https://github.com/gaufung/rabbitmqadapter
- Owner: gaufung
- Created: 2019-07-05T09:26:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-06T02:05:24.000Z (almost 6 years ago)
- Last Synced: 2024-12-29T03:47:39.781Z (4 months ago)
- Topics: asynchronous, pika, rabbitmq, rabbitmq-client, tornado
- Language: Python
- Homepage:
- Size: 140 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RabbitMQ's Tornado Advance APIs
## 1 Background
[`pika`](https://pika.readthedocs.io/en/stable/) 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
```python
@gen.coroutine
def publish(self, exchange, routing_key, body, properties=None, mandatory=True, return_callback=None, close_callback=None):
pass
```### 2.2 Consumer
```python
@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
```python
@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.