python 创建 celery 任务作业
假设我有一个 python 程序,我想使用 celery / rabbigmq 最多并行运行 10 次,如果某些进程完成,我想了解它,以便我可以启动一个新进程。我怎样才能这样做?一些例子会很好
lets say i have a python programm whitch i want to run always max 10 times in parallel using celery / rabbigmq and if some of the process finish i want to know about it so i can start a new process. how can i do so? some examples would be nice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
举个例子很困难,因为消息传递有点复杂,但你基本上可以做的是:
或者,如果你想在一项任务完成后手动启动一项任务,你可以可以配置 Celery 在完成后发送消息(我还没有尝试过,但看看 CELERY_RESULT_BACKEND)然后您可以使用这些消息并开始您的任务。
Giving an example is difficult as messaging is a bit complex, but what you can do basically is:
Alternatively, if your want to start a task manually after one finished, you can configure Celery to send a message after its finished (I didn't try it yet, but have a look at CELERY_RESULT_BACKEND) You can then consume these messages and start your task.