我可以使用Python中的Asyncio库可行运行两个/多个RabbitMQ消费者。如果是,怎么样?
我试图在一个电话中运行多个RabbitMQ消费者。但是在Python中,由于其同步性质,其他消费者直到第一次关闭才开始。我可以使用asyncio
库并行运行多个消费者吗?是的,我该怎么做?
我目前正在使用线程运行多个消费者并使用pika 1.2.0
。
谢谢 :)
I am trying to run multiple rabbitMQ consumers in a single call. But in python, other consumers won't start until first one is closed, due to its synchronous nature. Can I use asyncio
library to run multiple consumers in parallel? Is yes, how can I do that?
I am currently using threads to run multiple consumers and using pika 1.2.0
.
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论