credis-2.0.1
توضیحات
high performance redis client implemented with cython
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | credis-2.0.1 |
| نام | credis |
| نسخه کتابخانه | 2.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | yihuang |
| ایمیل نویسنده | yi.codeplayer@gmail.com |
| آدرس صفحه اصلی | https://github.com/yihuang/credis |
| آدرس اینترنتی | https://pypi.org/project/credis/ |
| مجوز | MIT |
minimal redis client written in cython, 5X faster than redis-py.
Tutorial
========
execute command
---------------
.. code-block:: python
>>> 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
--------------------------
.. code-block:: python
>>> commands = [('set', 'test%d'%i, i) for i in range(3)]
>>> conn.execute_pipeline(*commands)
('OK', 'OK', 'OK')
connection pool for gevent
--------------------------
.. code-block:: python
>>> 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')
نیازمندی
| مقدار | نام |
|---|---|
| >=1.1.0,<2.0.0 | hiredis |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl credis-2.0.1:
pip install credis-2.0.1.whl
نصب پکیج tar.gz credis-2.0.1:
pip install credis-2.0.1.tar.gz