gpt4 book ai didi

Python 进程间总线

转载 作者:太空宇宙 更新时间:2023-11-03 17:54:56 25 4
gpt4 key购买 nike

我完全用我的机器人大脑重新开始。全部都是用Python开发的。

我希望一切尽可能模块化,并允许使用多个 CPU 内核 (Raspberry PI 2)。

我想到使用多个进程。一个用于串行通信,一个用于每个传感器,一个用于每个更高的功能。所有这些都通过转向“大脑”功能连接。

我想通过消息总线连接进程。例如。如果每个传感器都有自己的总线。然后高级功能和大脑就可以登录到总线上。在最佳情况下,我也想发送整个对象。

  • 有没有一个好的框架来提供总线?
  • 对于整个主题是否有更好的方法?

谢谢

罗伯特

最佳答案

尝试nanomsg (ZeroMQ的后续项目):

nanomsg is a socket library that provides several common communication patterns. It aims to make the networking layer fast, scalable, and easy to use. Implemented in C, it works on a wide range of operating systems with no further dependencies.

The communication patterns, also called "scalability protocols", are basic blocks for building distributed systems. By combining them you can create a vast array of distributed applications. The following scalability protocols are currently available:

  • PAIR - simple one-to-one communication
  • BUS - simple many-to-many communication
  • REQREP - allows to build clusters of stateless services to process user requests
  • PUBSUB - distributes messages to large sets of interested subscribers
  • PIPELINE - aggregates messages from multiple sources and load balances them among many destinations
  • SURVEY - allows to query state of multiple applications in a single go

关于Python 进程间总线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28616358/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com