No project description provided
Project description
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.get_event_loop().run_until_complete(consumer.start())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aioamqp-consumer-best-1.1.1.tar.gz
.
File metadata
- Download URL: aioamqp-consumer-best-1.1.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dda6904c9f7ee4219f924027c166ec63850f71806bd5800378949acfb1cc5ba8 |
|
MD5 | c211dbdb62cab1c536a9af2a5ca65d45 |
|
BLAKE2b-256 | 58bd0f5595bc4e97dafb76cfd121e59231c37ef450f3b23fc2952086b931360a |
Provenance
File details
Details for the file aioamqp_consumer_best-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: aioamqp_consumer_best-1.1.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4b8ef7d544227041b42ffc0c49b0f1cb34c8cb16231a9f2e331ccca805f7e56 |
|
MD5 | 54de8cafea047668dbe0be52be17f1dd |
|
BLAKE2b-256 | 535510958c912fc2259da4a32c208b15dcb3daea5934bb558ded6fa94b7e91e4 |