thread safe connection pool
Project description
Thread-safe connection pool for python
Examples
Create a pool
import memcache from connection_pool import ConnectionPool # via create function def create_memcache_client(): return memcache.Client(['127.0.0.1:11211']) pool = ConnectionPool(create=create_memcache_client, max_size=10, max_usage=10000, idle=60, ttl=120) # via lambda pool = ConnectionPool(create=lambda: memcache.Client(['127.0.0.1:11211']), max_size=10) # via functools.partial from functools import partial pool = ConnectionPool(create=partial(memcache.Client, ['127.0.0.1:11211']), max_size=10) # using a connection with pool.item() as memcache: memcache.set('foo', 'bar')
License
he MIT License (MIT). Please see License File for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size connection_pool-0.0.2-py3-none-any.whl (3.7 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size connection_pool-0.0.2.tar.gz (3.4 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for connection_pool-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b20648cb502cd9ccce0d975660e66a2716828ab5d483bb3a6b1c3862d9e20f58 |
|
MD5 | 0cf5d3a450c7f33714c7e74dab79764e |
|
BLAKE2-256 | 359d0b32b82ec09b709014e55caedab71351dff09c723d962e8d5ce4c81c5802 |