https://github.com/redislabs/redis-pipeline
Non blocking pipelined python client for redis and redis protocol parser.
https://github.com/redislabs/redis-pipeline
Last synced: about 1 year ago
JSON representation
Non blocking pipelined python client for redis and redis protocol parser.
- Host: GitHub
- URL: https://github.com/redislabs/redis-pipeline
- Owner: RedisLabs
- License: mit
- Created: 2014-07-23T07:09:08.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-04T08:04:05.000Z (almost 12 years ago)
- Last Synced: 2025-04-06T17:03:05.882Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 168 KB
- Stars: 6
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
redispipeline
=============
Non blocking pipelined python client for redis.
Usage example
-------------
.. code-block:: python
import redispipeline
r = redispipeline.RedisPipeline(pipeline_depth = 3)
r.set('x',1)
r.get('x')
r.set('y',2)
r.get('y') # This will block until we get the response from 'set x 1' because it's the 4th command and pipeline_depth is 3
print r.getResponse() # Print 'OK' (we know there's at least one response received because we blocked in previous command)
print r.getResponse() # Print '1' (or None if no response received yet)
r.sendCmd('PING') # I don't support all redis commands yet, but with sendCmd you can call whatever you want
print r.flushPipeline() # Wait for all pending responses to be received, will print "['OK','2','PONG']" or "['1', 'OK','2','PONG']" depending on previous line's result