admin管理员组文章数量:1415460
I know the electron ipc module allows one main process to municate with multiple render process. On top of this, is there a way to use another main process to municate with multiple main processes simultaneously?
I know the electron ipc module allows one main process to municate with multiple render process. On top of this, is there a way to use another main process to municate with multiple main processes simultaneously?
Share Improve this question asked Mar 27, 2016 at 2:49 user3669481user3669481 3277 silver badges19 bronze badges 2- What do you mean by "multiple main processes"? Multiple Electron apps? – Max Commented Mar 27, 2016 at 13:00
- yes multiple electron apps – user3669481 Commented Mar 28, 2016 at 3:36
3 Answers
Reset to default 6As 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 munication 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 munication library/method? provides some possible answers. One of the answers points to the node-ipc project on GitHub: https://github./RIAEvangelist/node-ipc. This particular solution appears to use sockets to pass the messages.
This may help -- https://itnext.io/multi-threading-and-multi-process-in-node-js-ffa5bb5cde98
I use child_process.fork()
https://github./rep2recall/rep2recall/blob/1873d17e281f934b0224751a9c29a518324fb9ad/packages/e-app/app.js#L2
child_process.spawn will work for this particular problem
本文标签: javascriptIs there a way to communicate between multiple electron main processesStack Overflow
版权声明:本文标题:javascript - Is there a way to communicate between multiple electron main processes? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745190083a2646871.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论