user3669481
user3669481

Reputation: 327

Is there a way to communicate between multiple electron main processes?

I know the electron ipc module allows one main process to communicate with multiple render process. On top of this, is there a way to use another main process to communicate with multiple main processes simultaneously?

Upvotes: 5

Views: 3479

Answers (3)

Shawn Rakowski
Shawn Rakowski

Reputation: 5714

As far as I know there is no built-in facility for doing this in Electron. That being said, the answer to your question is the same as the answer to the broader question of how to do inter process communication in Node.js, to which there are multiple answers. You can use sockets directly, file passing, databases, messaging systems, Redis, etc...

This question: What's the most efficient node.js inter-process communication library/method? provides some possible answers. One of the answers points to the node-ipc project on GitHub: https://github.com/RIAEvangelist/node-ipc. This particular solution appears to use sockets to pass the messages.

Upvotes: 6

user3669481
user3669481

Reputation: 327

child_process.spawn will work for this particular problem

Upvotes: -2

Related Questions