Skip to main content

a connection pool wrapper about async pika

Project description

Notice

just support twisted connection now

Usage

sample:

# with connection
from pika import URLParameters
from pooled_pika import PooledConn

AMQP_PARAM = URLParameters('amqp://user:pwd@amqpserver')
pooled_conn = PooledConn(AMQP_PARAM)
d = pooled_conn.acquire()
d.addCallbacks(_on_conn, _on_err_conn) # you will get a TwistedProtocolConnection object
d.addErrback(_on_err)
d.addBoth(pooled_conn.release)  # must release what acquired anyway

or:

# with channel
from pika import URLParameters
from pooled_pika import PooledConn

AMQP_PARAM = URLParameters('amqp://user:pwd@amqpserver')
pooled_conn = PooledConn(AMQP_PARAM)
d = pooled_conn.acquire(channel=True)
d.addCallbacks(_on_channel, _on_err_channel) # you will get a TwistedChannel object
d.addErrback(_on_err)
d.addBoth(pooled_conn.release)  # must release what acquired anyway

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

pooled-pika-0.3.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

pooled_pika-0.3.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pooled-pika-0.3.0.tar.gz.

File metadata

  • Download URL: pooled-pika-0.3.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pooled-pika-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3137b73c1e509e4c4a487c12942dc972da15a0993965840f79012c66cd7c7861
MD5 2eb92dac936d6fb6f4e491a19ad38a20
BLAKE2b-256 7b801e174cd913c378a338e862ae8a7f3e69c688119095a485732cefd532d3ae

See more details on using hashes here.

File details

Details for the file pooled_pika-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pooled_pika-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pooled_pika-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2f05e350bfc72a9bdda63bcb32d92ff1f4a848a1a9baae9541729afe243bdfd
MD5 fd3bdc26fce6310d9a5f9f4db094816e
BLAKE2b-256 6472b1e633732e20303cd59f9a807009bd7bfc5f6e0bd4fad026069396209085

See more details on using hashes here.

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