Register a request/response channel via ipcMain.handle.
Register a one-shot request/response channel via ipcMain.handleOnce.
Scoped to the process, not a window: ipcMain is global, so the
first caller from any window consumes the handler and every later
invoke — including from other windows — rejects with "No handler
registered". Use handle for anything a multi-window app can call more
than once.
Register a fire-and-forget channel via ipcMain.on.
Register a one-shot fire-and-forget channel via ipcMain.once.
Process-scoped like handleOnce: the first message from any window consumes the listener, and later sends are silently ignored.
Register a streaming channel: every value the returned (async) iterable yields is sent to the renderer as one chunk, in order.
event.signal is per invocation here, and aborts when the renderer
cancels the stream or its WebContents is destroyed. Either way the
iterator's return() runs, so a generator's finally blocks execute.
Build
handle/handleOnce/listen/listenOnce/streamhelpers bound to a specific emitted-event mapTEmit.The
TEmittype flows intoevent.reply,event.sender.send, andevent.senderFrame?.sendinside each callback, giving fully typed emits.