Search code examples
pythonredispython-huey

Setting Huey to use Redis with Flask


enter image description here

I'm experimenting with the use of Huey as a cross platform task queue . I've found https://github.com/pjcunningham/flask-huey-example , which I've cloned and set up a virtualenv for using conda. (I'm working on windows) following the readme I tried:

$ python run_app.py

when I open http://localhost:6060/

enter image description here

I can click on the send button and I see the screenshot. But Although a list is created in REDIS, no task is stored:

127.0.0.1:6379> keys *
1) "huey.redis."
127.0.0.1:6379> lrange huey.redis -100 100
(empty list or set)

How Can I send tasks to the REDIS task queue ?


Solution

  • I've updated the Readme with instructions on how to run Example 1.

    As well as running the Flask app you need to start the Huey task consumer and start the dummy SMTP server before you click on the Send button.

    Note the parameter passed when starting the Huey consumer (Step 2 in the readme):

    (flask-huey-example) python d:\Paul\.virtualenv\flask-huey-example\Scripts\huey_consumer.py run_huey.huey
    

    The parameter is the dotted path to the huey object instance created in the Python script run_huey.py.