简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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