HotQueue

HotQueue is a Python library that allows you to use Redis as a FIFO message queue within your Python programs. Using HotQueue looks a little bit like this…

Establishing a queue:

>>> queue = HotQueue("myqueue")

Putting messages onto the queue:

>>> queue.put("my message")
>>> queue.put({'name': "Richard Henry", 'eyes': "blue"})

Getting messages off the queue:

>>> queue.get()
"my message"
>>> queue.get()
{'name': 'Richard Henry', 'eyes': 'blue'}

Iterating over a queue indefinitely, waiting if nothing is available:

>>> for item in queue.consume():
...     print item

More advanced features that make it easy to work with queues are available. To go deeper, you should read the HotQueue Tutorial.

The main advantage of the HotQueue model is that there is no queue server to run since the redislite module will handle starting/stopping a redis server automatically as needed. Plus, Redis is really fast!

Installation

To install it, run:

pip install -U redislite-hotqueue

It also works with easy_install, if that’s your jam. You can download versioned packages directly from PyPI.

The source code is available on GitHub and is a fork of the code available at`GitHub <http://github.com/richardhenry/hotqueue>`_.

To get help with HotQueue, use the HotQueue Users mailing list.

Requirements

  • Python 2.7+ (tested on versions 2.7.10, 3.4.3, and pyp 2.6.1)
  • redislite 1.0.254+