MoonQueue is another Queue Library using Redis as storage.
pip install moonqueue
>>> from moonqueue import RedisQueueList
>>> r = RedisQueueList('list:myqueue')
# push one message
>>> r.push(['apple'])
(('list:myqueue', 1),)
>>> r.pop()
('list:myqueue', b'apple')
# push multiple messages
>>> r.push(['apple', 'banana'])
(('list:myqueue', 2),)
>>> r.pop()
('list:myqueue', b'apple')
>>> r.pop()
('list:myqueue', b'banana')
>>> r.pop()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/web/moonqueue/moonqueue/redis_queue_list.py", line 52, in pop
raise EmptyQueueException(excep_msg)
moonqueue.excep.EmptyQueueException: list:myqueue is empty
>>> from moonqueue import RedisQueueList
>>> r = RedisQueueList(['list:myqueue1', 'list:myqueue2'])
>>> r.get_queues()
['list:myqueue1', 'list:myqueue2']
# push one message - it will be pused to all queues
>>> r.push(['apple'])
(('list:myqueue1', 1), ('list:myqueue2', 1))
# pop from queues
>>> r.pop()
('list:myqueue1', b'apple')
>>> r.pop()
('list:myqueue2', b'apple')
>>> r.pop()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/web/moonqueue/moonqueue/redis_queue_list.py", line 52, in pop
raise EmptyQueueException(excep_msg)
moonqueue.excep.EmptyQueueException: ['list:myqueue1', 'list:myqueue2'] is empty