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.1.1.tar.gz (3.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pooled-pika-0.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pooled-pika-0.1.1.tar.gz
Algorithm Hash digest
SHA256 68c5ea6a521a0267ec6acd7f6264fe9f40b722507f8e98ee3b456c3fa1521d98
MD5 4bd5453cabf0527bb203ff6f95c03fc2
BLAKE2b-256 b6b27572621d01e0194eaedf7b9ec11a6f4f332e6dc911f5d1469d7b4b660abf

See more details on using hashes here.

Supported by

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