6

Are there any ordering guarantees of ipc messages in Electron? If so, what are they?

For instance, in main:

window.webContents.send('channel-a', 1)
window.webContents.send('channel-a', 2)

And in the renderer:

ipcRenderer.on('channel-a', (_event, num) => console.log(num))

Are the messages always delivered in order to the renderer (such that 1 comes before 2 in the example above)?

If so, are they also always ordered if the messages are on different channels (e.g. by changing channel-a to channel-b in one of the lines above)?

Betamos
  • 26,448
  • 9
  • 23
  • 28
  • I guess implementing a hacky solution like [this](https://stackoverflow.com/a/47653853/9698583) is currently the only way to guarantee order. I don't know if there's a better way. – aabuhijleh Mar 09 '20 at 15:12

0 Answers0