AMQPStorm connection pooling based on pika-pooling.
Project description
AMQPStorm connection pooling based on pika-pool.
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'}
}
)
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
AMQPStorm-Pool-1.0.tar.gz
(5.4 kB
view details)
Built Distribution
File details
Details for the file AMQPStorm-Pool-1.0.tar.gz
.
File metadata
- Download URL: AMQPStorm-Pool-1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd65bd08c6c491dbef792ade7c004a3992135c6ca8f4ab9a81321a6cc809c075 |
|
MD5 | c3da42a3fc8e13f93e82f77566d7621a |
|
BLAKE2b-256 | 232a467c490a89cfe6669a6cabbb5d752f96b6e6d4995be0170f4c19cecb61f9 |
Provenance
File details
Details for the file AMQPStorm_Pool-1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: AMQPStorm_Pool-1.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 555f8e25314c6c995a499a3840a8d1fe567fe25c087d91f55ee79d8581f3c004 |
|
MD5 | 8b17c93a4fc2360e7826b0d2cb04c4b5 |
|
BLAKE2b-256 | 4ef2661c4c9f001018b79b5087738011ddd351e23d5c46c95bc9091413c303cf |