https://github.com/eandersson/amqpstorm-pool
AMQPStorm connection pooling based on pika-pooling.
https://github.com/eandersson/amqpstorm-pool
amqp amqp-client amqp0-9-1 amqpstorm pooling python python2 python3 rabbitmq rabbitmq-client
Last synced: 2 months ago
JSON representation
AMQPStorm connection pooling based on pika-pooling.
- Host: GitHub
- URL: https://github.com/eandersson/amqpstorm-pool
- Owner: eandersson
- License: other
- Created: 2020-06-25T09:02:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-18T01:50:09.000Z (about 4 years ago)
- Last Synced: 2025-01-19T06:41:16.697Z (4 months ago)
- Topics: amqp, amqp-client, amqp0-9-1, amqpstorm, pooling, python, python2, python3, rabbitmq, rabbitmq-client
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
AMQPStorm-Pool
==============
`AMQPStorm `_ connection pooling based on `pika-pool `_.|Version| |Travis| |Coverage|
usage
-----Get it:
.. code:: bash
pip install amqpstorm-pool
and use it:
.. code:: python
import json
import amqpstorm
import amqpstorm_pooluri = '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'}
}
).. |Version| image:: https://badge.fury.io/py/AMQPStorm-Pool.svg
:target: https://badge.fury.io/py/AMQPStorm-Pool.. |Travis| image:: https://travis-ci.org/eandersson/amqpstorm-pool.svg
:target: https://travis-ci.org/eandersson/amqpstorm-pool.. |Coverage| image:: https://codecov.io/gh/eandersson/amqpstorm-pool/branch/master/graph/badge.svg
:target: https://codecov.io/gh/eandersson/amqpstorm-pool