aioamqp-consumer-best
Usage
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())
Metadata
Release files for aioamqp-consumer-best 2.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aioamqp-consumer-best-2.4.0.tar.gz | 11.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aioamqp_consumer_best-2.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.6 kB
Release files / aioamqp-consumer-best-2.4.0.tar.gz
| Download URL | aioamqp-consumer-best-2.4.0.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bb6cff9c369c9a501bbceb42c78ea9714d6e1cc19281f011a246eec91f7bb03
|
|
BLAKE2b-256 checksum How to use checksums |
8fcf3a4b94c2295aac02a1552906be458d362c52b660ca638c7e563cef7993f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / aioamqp_consumer_best-2.4.0-py3-none-any.whl
| Download URL | aioamqp_consumer_best-2.4.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
137be99e3fd5dcbc5409dcb5b0d4795ff7d3e20470704f7c1fe27da813f3d176
|
|
BLAKE2b-256 checksum How to use checksums |
1d17026450f843518f298aaaa95965c316815ddd5b038e42188274e6c270342f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|