Skip to main content

AMQPStorm connection pooling based on pika-pooling.

Project description

AMQPStorm connection pooling based on pika-pool.

Version Travis Coverage

usage

Get it:

pip install amqpstorm-pool

and use it:

import json

import amqpstorm
import amqpstorm_pool

uri = 'amqp://guest:guest@localhost:5672/%2F?heartbeat=60'
pool = amqpstorm_pool.QueuedPool(
    create=lambda: amqpstorm.UriConnection(uri),
    max_size=10,
    max_overflow=10,
    timeout=10,
    recycle=3600,
    stale=45,
)

with pool.acquire() as cxn:
    cxn.channel.queue.declare('fruits')
    cxn.channel.basic.publish(
        body=json.dumps({
            'type': 'banana',
            'description': 'they are yellow'
        }),
        exchange='',
        routing_key='fruits',
        properties={
            'content_type': 'text/plain',
            'headers': {'key': 'value'}
        }
    )

Download files

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

Files for AMQPStorm-Pool, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size AMQPStorm_Pool-1.0.1-py2.py3-none-any.whl (6.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size AMQPStorm-Pool-1.0.1.tar.gz (6.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page