Python 进程之间的总线

Python bus between processes

我完全从我的机器人大脑开始。一切都是在 Python 中开发的。

我想尽可能保持一切模块化,并允许使用多个 CPU 核心 (Raspberry PI 2)。

我想到了使用多进程。一个用于串行通信,一个用于每个传感器,一个用于每个更高的功能。 全部通过转向 "brain" 功能连接。

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

谢谢

罗伯特

尝试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