Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.
/ credis Public archive
forked from yihuang/credis

## Auto-archived due to inactivity. ## redis client implement with cython

License

Notifications You must be signed in to change notification settings

DataDog/credis

 
 

Repository files navigation

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')

About

## Auto-archived due to inactivity. ## redis client implement with cython

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Cython 61.4%
  • Python 38.6%