Skip to content

[question] Does electron-trpc support communication between windows? #215

Answered by jsonnull
liaodalin19903 asked this question in Q&A
Discussion options

You must be logged in to vote

It's possible to do this with vanilla Electron IPC like this:

  • subscribe to an IPC channel from each window
  • publish messages from one window to the main thread
  • have the main thread broadcast messages to all windows

I can imagine you could adapt this to a tRPC pattern:

  • create subscriptions in each window which wants to receive messages
  • each subscription in the router is now part of a PubSub store of some kind
  • send messages to the router from one window in a mutation and have the router handle the mutation by forwarding the message to the PubSub store which can then broadcast to active subscriptions

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by liaodalin19903
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #206 on December 07, 2024 21:03.