I am new to redis and celery. I have gone through the basic tutorial of both, but I am not getting how to implement then in task scheduling job
I am unable to start with the scripting part. I am not getting how to write a script to make a queue, run the workers etc. I would need a practical example
So here’s a cannonical example of how can celery run with Redis (let the script filename be mytasks.py):
As you see, broker argument was set to use Redis installed on your local machine. The next thing is to start celery server:
As your tasks celery server has been started, you can now use it to run your task just by importing mytasks script, e.g from Python interpreter interactive mode:
After some time ‘2’ will appear in console.
That’s a basic example of how you can setup your tasks execution environment.