high performance redis client implemented with cython
Project description
minimal redis client written in cython, 5X faster than redis-py.
Tutorial
execute command
>>> from credis import Connection
>>> conn = Connection(host='127.0.0.1', port=6379)
>>> conn.execute('set', 'test', 1)
'OK'
>>> conn.execute('get', 'test')
'1'
execute pipelined commands
>>> commands = [('set', 'test%d'%i, i) for i in range(3)]
>>> conn.execute_pipeline(*commands)
('OK', 'OK', 'OK')
connection pool for gevent
>>> from credis.geventpool import ResourcePool
>>> pool = ResourcePool(32, Connection, host='127.0.0.1', port=6379)
>>> with pool.ctx() as conn:
... conn.execute('get', 'test')
'1'
>>> pool.execute('get', 'test')
'1'
>>> commands = [('get', 'test%d'%i) for i in range(3)]
>>> pool.execute_pipeline(*commands)
('1', '2', '3')
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.
Source Distribution
credis-2.0.1.tar.gz
(6.0 kB
view hashes)
Built Distributions
Close
Hashes for credis-2.0.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcc9c0cea01c835ff1bbf04bf52a8f5e3e1effd537d39e9fa842303de198ef7f |
|
MD5 | 05c8cbd9b0ae0a93fcf3494c1a758ca4 |
|
BLAKE2b-256 | b740beff50f79ae605e5f240cdeefd7ed41d437cf8ebe98188830c1db8c9b0cd |
Close
Hashes for credis-2.0.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f05d4b897d9d945f9857f7959216f89fb62e05809c938ff8abc1b84b806539 |
|
MD5 | 4954762e865e2ec7dffedafc4da61153 |
|
BLAKE2b-256 | 470feddf637302e9bd6e328c6fcd360bc1cf3494ec20faaafe8e3f072ba9de5b |