A persistent, (mostly) atomic queue (like deque or Queue) implemented with redis backing.
Project description
- redis_queue is useful for implementing a multi-producer,
multi-consumer job queue. While it doesn’t have all the handy blocking and locking features of Queue, it does have the advantages of being multi-process safe and persistant.
- Example Usage:::
>>> from redis import Redis >>> from redis_queue import Queue >>> redis = Redis(host='127.0.0.1', port=6379) >>> queue = Queue(redis, 'test_queue') >>> queue.append('one') >>> queue.append('two') >>> queue.append('three') >>> queue.pop() 'three' >>> queue.pop() 'two' >>> queue.pop() 'one' >>> queue.append('one') >>> queue.append('two') >>> queue.append('three') >>> queue.popleft() 'one' >>> queue.popleft() 'two' >>> queue.popleft() 'three'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
redis_queue-0.2.tar.gz
(7.5 kB
view details)
File details
Details for the file redis_queue-0.2.tar.gz
.
File metadata
- Download URL: redis_queue-0.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e9401958630ecbbb27c35e83d4648a6ad668d71d2e2c00550a35e877b2e2ec2 |
|
MD5 | 51a630b0641dbf537669226e20f56862 |
|
BLAKE2b-256 | 550a004df5ac7e715ec056a1f45860d321a9caacd82ff5fb2c382f80694ab55b |