Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can celery assign task to specify worker

Tags:

python

celery

Celery will send task to idle workers.

I have a task will run every 5 seconds, and I want this task to only be sent to one specify worker.

Other tasks can share the left over workers

Can celery do this??

And I want to know what this parameter is: CELERY_TASK_RESULT_EXPIRES
Does it means that the task will not be sent to a worker in the queue?
Or does it stop the task if it runs too long?

like image 501
user2492364 Avatar asked Dec 26 '15 02:12

user2492364


1 Answers

Sure, you can. Best way to do it, separate celery workers using different queues. You just need to make sure that task you need goes to separate queue, and your worker listening particular queue. Long story for this: http://docs.celeryproject.org/en/latest/userguide/routing.html

like image 105
Rustem Avatar answered Sep 20 '22 07:09

Rustem