Skip to main content
Help us improve Python packaging – donate today!

Pools for pikas.

Project Description

https://travis-ci.org/bninja/pika-pool.png https://coveralls.io/repos/bninja/pika-pool/badge.png?branch=master

Pika connection pooling inspired by:

Typically you’ll go with local shovels, krazee-eyez kombu, etc. but this works too.

usage

Get it:

pip install pika-pool

and use it:

import json

import pika
import pika_pool

params = pika.URLParameters(
   'amqp://guest:guest@localhost:5672/?'
   'socket_timeout=10&'
   'connection_attempts=2'
 )

 pool = pika_pool.QueuedPool(
     create=lambda: pika.BlockingConnection(parameters=params),
     max_size=10,
     max_overflow=10,
     timeout=10,
     recycle=3600,
     stale=45,
 )

 with pool.acquire() as cxn:
     cxn.channel.basic_publish(
         body=json.dumps({
             'type': 'banana',
             'description': 'they are yellow'
         }),
         exchange='',
         routing_key='fruits',
         properties=pika.BasicProperties(
             content_type='application/json',
             content_encoding='utf-8',
             delivery_mode=2,
         )
     )

release

Tests pass:

py.test test.py --cov=pika_pool --cov-report term-missing

so update __version__ in:

  • __init__.py

then commit and tag it:

git commit -am "release v{version}"
git tag -a v{version} -m "release v{version}"
git push --tags

and travis will publish it to pypi.

Release history Release notifications

This version
History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pika-pool-0.1.3.tar.gz (4.7 kB) Copy SHA256 hash SHA256 Source None Nov 23, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page