如何使用 Ampoule 和 Twisted 创建本地和远程进程混合的池?
有人告诉我,一个基于 Twisted 的库Ampoule 是创建在不同计算机上执行的进程池的好方法。然而,没有这方面的文档,安瓿的例子也没有说明这一点。
我对类似于 stdlib multiprocessing.Pool.map() 的界面非常满意,
您能提供一个示例吗?
I've been told, that a Twisted-based library Ampoule is a great way to create a pool of processes that are executed on different computers. However there is no docs for that and Ampoule's examples also don't make it any clear.
I'd be totally happy with interface similar to stdlib multiprocessing.Pool.map()
Could you supply an example, please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ampoule 本身不具备多主机操作能力。由于它使用 AMP 并在父进程和子进程之间严格定义交互,因此您当然可以想象将其扩展以支持多主机操作。但是,您仍然必须解决连接到另一台主机(可能使用 Twisted Conch 通过 SSH)并向其部署必要的 Python 库的问题,以便它能够执行您希望分配给它的任务。
Ampoule is not natively capable of multi-host operation. Since it uses AMP with strictly defined interactions between the parent and child processes, you could certainly imagine extending it to support multi-host operation. However, you must still solve the problem of connecting to another host (perhaps via SSH using Twisted Conch) and deploying the necessary Python libraries to it for it to be able to execute the tasks you wish to assign to it.