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.0.tar.gz
(4.6 kB
view hashes)