[英]Custom routing for subtask in Celery taskset
Is it possible to set subtask parameters "queue" and "routing_key" not in apply_async(). 是否可以在apply_async()中设置子任务参数“queue”和“routing_key”。
It is necessary in Taskset that each subtask went to custom queue and routing_key. 在Taskset中,每个子任务都必须转到自定义队列和routing_key。
Looks like: 看起来像:
tasks = []
for item in items:
tasks.append(task_name.s((params).<method for set custom queue and routing_key>))
job = TaskSet(tasks=tasks)
It is not too clear what is the question. 问题是什么并不太清楚。 If you are asking if you can give
routing_key
and queue
arguments to subtasks you can if you use subtask()
instead of s()
. 如果您询问是否可以将
routing_key
和queue
参数赋予子任务,则可以使用routing_key
subtask()
而不是s()
。
options – Additional options to Task.apply_async().
options - Task.apply_async()的附加选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.