This is a prototype to schedule jobs in the backend based on some priority using Rabbitmq and Celery.
This is a prototype to schedule jobs in the backend based on some priority using Rabbitmq and Celery.
In this sample project, the powers of Celery and RabbitMQ in prioritized tasking can be seen. The simulation for transcoding a video to
Of course this isn't even close to the real scencario, but it's good enough to observe the prioritized tasking.
These are the things to keep in mind to enable priority tasking without getting into trouble or unnecessary errors.
'x-max-priority': 10
This argument must be provided to the queue so that RabbitMQ knows that tasks should be prioritized.CELERY_ACKS_LATE = True
CELERYD_PREFETCH_MULTIPLIER = 1
pip install -r requirements.txt
and go into the directory cd celery-priority-tasking/celery_sample_project
.python main.py
for starting up Flask.celery worker -c [number of workers] -A tasks -Q tasks --loglevel=info &
.There is a small preview video here with only 1 Celery worker so that it's easy to observe the tasks getting sorted.
To install dependencies on Debian machines, use the script provided or otherwise modify it accordingly for other operating systems.