<commit_before>=========
pika-pool
=========

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

Pika connection pooling inspired by:

- `flask-pika <https://github.com/WeatherDecisionTechnologies/flask-pika>`_
- `sqlalchemy.pool.Pool <http://docs.sqlalchemy.org/en/latest/core/pooling.html#sqlalchemy.pool.Pool>`_

Typically you'll go with local shovel(s), krazy kombu, etc. but this might work too.

Get it:

.. code:: bash

   $ pip install pika-pool

and use it:

.. code:: python

   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),<commit_msg>does work<commit_after>=========
pika-pool
=========

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

Pika connection pooling inspired by:

- `flask-pika <https://github.com/WeatherDecisionTechnologies/flask-pika>`_
- `sqlalchemy.pool.Pool <http://docs.sqlalchemy.org/en/latest/core/pooling.html#sqlalchemy.pool.Pool>`_

Typically you'll go with local shovel(s), `krazee-eyez kombu <http://bit.ly/1txcnnO>`_, etc. but this works too.

Get it:

.. code:: bash

   $ pip install pika-pool

and use it:

.. code:: python

   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),
{'fraction_non_alphanumeric': 0.16119402985074627, 'fraction_numerical': 0.007462686567164179, 'mean_word_length': 3.644341801385681, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1108296', 'n_tokens_mistral': 779, 'n_tokens_neox': 727, 'n_words': 120}