Skip to main content

No project description provided

Project description

aioamqp-consumer-best

PyPI version Build Status codecov

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aioamqp-consumer-best-1.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

aioamqp_consumer_best-1.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

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

Hashes for aioamqp-consumer-best-1.1.1.tar.gz
Algorithm Hash digest
SHA256 dda6904c9f7ee4219f924027c166ec63850f71806bd5800378949acfb1cc5ba8
MD5 c211dbdb62cab1c536a9af2a5ca65d45
BLAKE2b-256 58bd0f5595bc4e97dafb76cfd121e59231c37ef450f3b23fc2952086b931360a

See more details on using hashes here.

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

Hashes for aioamqp_consumer_best-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4b8ef7d544227041b42ffc0c49b0f1cb34c8cb16231a9f2e331ccca805f7e56
MD5 54de8cafea047668dbe0be52be17f1dd
BLAKE2b-256 535510958c912fc2259da4a32c208b15dcb3daea5934bb558ded6fa94b7e91e4

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page