开发者

Simple queue with Celery and RabbitMQ

开发者 https://www.devze.com 2023-01-24 06:56 出处:网络
I\'m trying to implement a simple queue that performs one task at a time. Offloading tasks off开发者_如何学Go the main thread using Celery and setting concurrency=1 in the Celery config works fine, bu

I'm trying to implement a simple queue that performs one task at a time. Offloading tasks off开发者_如何学Go the main thread using Celery and setting concurrency=1 in the Celery config works fine, but I might want to use more concurrent workers for other tasks.

Is there a way to tell Celery or RabbitMQ to not use multiple concurrent workers for a task (except by forcing concurrency=1)? I can't find anything in the documentation but maybe these tools are not designed for a linear queue?

Thanks!


I think what you need is a separate queue for each type of task. Create separate workers that consume from each queue, with concurrency set to 1.

0

精彩评论

暂无评论...
验证码 换一张
取 消