taskiq-python / taskiq

Distributed task queue with full async support
MIT License
689 stars 44 forks source link

Task Routing #302

Closed Trevypants closed 4 months ago

Trevypants commented 4 months ago

Hello,

I couldn't find anything in the current docs but is it possible to route tasks similar to what Celery does (https://docs.celeryq.dev/en/stable/userguide/routing.html)?

I am specifically working on an application where I have tasks that are lower and higher priority. The lower priority tasks are kicked at a much higher rate than my higher priority tasks and I would like to be able to route the tasks so that the higher priority tasks are not overwhelmed by the lower priority tasks.

Thanks in advance!

sector119 commented 4 months ago

https://github.com/taskiq-python/taskiq-aio-pika?tab=readme-ov-file#priorities

Trevypants commented 4 months ago

https://github.com/taskiq-python/taskiq-aio-pika?tab=readme-ov-file#priorities

This is great! Is there something similarly implemented for Redis?

sector119 commented 4 months ago

Redis knows nothing about priorities. If you need to set priority you should use rabbitmq. Celery has redis task priority support, but it is weird, it creates 4 queues: celery, celery1 - 3 as described at https://docs.celeryq.dev/en/stable/userguide/routing.html#redis-message-priorities It is not real task priorities, not broker server native priorities

Trevypants commented 4 months ago

Thank you for your advice! Will look into it :)