Skip to main content

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


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page