aioamqp-consumer-best-2.3.0
توضیحات
Consumer utility for AMQP
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aioamqp-consumer-best-2.3.0 |
| نام | aioamqp-consumer-best |
| نسخه کتابخانه | 2.3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Timofey Kukushkin |
| ایمیل نویسنده | tima@kukushkin.me |
| آدرس صفحه اصلی | https://github.com/tkukushkin/aioamqp-consumer-best |
| آدرس اینترنتی | https://pypi.org/project/aioamqp-consumer-best/ |
| مجوز | MIT |
# aioamqp-consumer-best
[](https://pypi.org/project/aioamqp-consumer-best/)

[](https://github.com/tkukushkin/aioamqp-consumer-best/actions?query=workflow%3Abuild+branch%3Amaster)
[](https://codecov.io/gh/tkukushkin/aioamqp-consumer-best)
## Usage
```python
import asyncio
from typing import List
from aioamqp_consumer_best import (
ConnectionParams,
Consumer,
Exchange,
Message,
ProcessBulk,
Queue,
QueueBinding,
ToBulks,
load_json,
)
async def callback(messages: List[Message]) -> None:
print(messages)
consumer = Consumer(
middleware=(
load_json
| ToBulks(max_bulk_size=10, bulk_timeout=3.0)
| ProcessBulk(callback)
),
prefetch_count=10,
queue=Queue(
name='test-queue',
bindings=[
QueueBinding(
exchange=Exchange('test-exchange'),
routing_key='test-routing-key',
),
],
),
connection_params=[ # Round robin
ConnectionParams(),
ConnectionParams.from_string('amqp://user@rmq-host:5672/'),
],
)
asyncio.run(consumer.start())
```
نیازمندی
| مقدار | نام |
|---|---|
| - | aioamqp |
| >=3.4 | anyio |
| - | aiodocker |
| <4 | mock |
| - | mypy |
| - | pycodestyle |
| - | pylint |
| - | pytest |
| - | pytest-asyncio |
| - | pytest-cov |
| <2,>=1.11.1 | pytest-mock |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| ~=3.7 | Python |
نحوه نصب
نصب پکیج whl aioamqp-consumer-best-2.3.0:
pip install aioamqp-consumer-best-2.3.0.whl
نصب پکیج tar.gz aioamqp-consumer-best-2.3.0:
pip install aioamqp-consumer-best-2.3.0.tar.gz