简体   繁体   English

节点IPC兄弟进程处理通信

[英]Node IPC Sibling Processes Communication

Assume the following architecture context: 假定以下架构上下文:

                                               +-----------------------------+                                       
                   Lobby Server Starts Process |                             |                                       
 +--------------+                              |  Network I/O process        |                                       
 |              +------------------------------>                             |  Client I/O     +--------------------+
 | Lobby Server |                              |                             <----------------->                    |
 |              |                              +---------------^-------------+                 | Client Application |
 ++-----+-------+                                              |                               |                    |
  |     |                                                      |                               |                    |
  |     |                                                      |                               |                    |
  |     |                                     +-----------------------------+   Client I/O     |                    |
  |     |       Lobby Server Starts Process   |                |            <------------------>                    |
  |     |                                     | Another Network|I/O Process |                  +--------------------+
  |     +------------------------------------->                |            |                                        
  |                                           +-----^-----------------------+                                        
  |                                                 |          |                                                     
  |                                                 |          |                                                     
  |    Lobby Server Starts Process                I |        I |                                                     
  |                                               P |        P |                                                     
  +-------------------------------+               C |        C |                                                     
                                  |                 |          |                                                     
                                  |            +----v----------v-----------------------+                             
                                  |            |                                       |                             
                                  +------------>   Application Server Logic Process    |                             
                                               |                                       |                             
                                               +---------------------------------------+

My question is, given the following design, what are good ways to implement the communication between the Network I/O servers and the logic server. 我的问题是,考虑到以下设计,在网络I / O服务器和逻辑服务器之间实现通信的好方法是什么? The logic server cannot depend on a specific network I/O process to work, eg if a Network I/O process goes down for some reason the logic process must continue to function. 逻辑服务器不能依靠特定的网络I / O进程来工作,例如,如果网络I / O进程由于某种原因而关闭,则逻辑进程必须继续运行。 All Network I/O processes and the logic process are child processes of the Lobby Server Process. 所有网络I / O进程和逻辑进程都是大堂服务器进程的子进程。

Essentially I am asking for ideas on how to implement the communication between sibling processes(Network I/O and Logic Server). 本质上,我是在寻求有关如何实现同级进程(网络I / O和Logic Server)之间通信的想法。 This is all written in Node, if there is a specific solution for Node, but a general idea would be helpful too. 如果有针对Node的特定解决方案,则所有内容都用Node编写,但是一般性的想法也会有所帮助。

This is a follow up on this question. 这是问题的后续措施。

PS: I am sorry if this is too general of a programming question and doesn't belong here. PS:很抱歉,这对编程问题来说太笼统了,不属于这里。 If this is the case I will remove it. 如果是这种情况,我将其删除。

The simplest and most scalable solution, in my opinion, would be ZeroMQ with this binding for Node . 我认为,最简单,最具扩展性的解决方案是ZeroMQ ,它具有Node的绑定。 ZeroMQ is a powerful implementation of the "sockets" concept whose communications backend can vary, so that it can be used equally well locally and remotely. ZeroMQ是“套接字”概念的强大实现,该概念的通信后端可以变化,因此可以在本地和远程同样有效地使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM