Can RxJS Observables perform inter-process communication in an Electron app?

倖福魔咒の 提交于 2019-12-11 14:55:32

问题


For an Electron app, I was wondering, if we could instead of using the remote module to communicate between different Renderer Processes, use Observables.

I have read that Renderer Processes and the Main process are completely different which would, the way I understand, restrict the usage of Observables.

I am also not completely aware of the details of an Observable. So please, go easy on me :P


回答1:


Per comment, I think there are some misreadings what Observable can do vs. can't do. Observable allows you to handle various asynchronous time-series event in a specific manner. Electron's remote module is entirely different, it aims to expose some of proxy object between processes in Electron.

For handling IPC's messages via observable, you could easily create event bindngs like fromEvent(IPCxxx, 'channel') //chain operator as you need but it doesn't gets rid of necessary of IPC itself, as it is essential to use any kind of ipc mechanism between processes in Electron - just matter of which mechanism you'll choose for.



来源:https://stackoverflow.com/questions/48509186/can-rxjs-observables-perform-inter-process-communication-in-an-electron-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!