We have an Electron.js (v15) app with multiple windows and proper contextIsolation. Each window may call child_process.execFile any time. The execFile process may rarely hangs, so I want to show a Cancel button to cancel execFile in the main process (through preload script).
The only solution which has came to my mind is some kind of global registry of AbortControllers in the main process (e.g. Map<string, AbortController>) and the browser process would have to manage that registry by some unique string IDs (e.g. UUIDs).
Is there any simpler solution, how to propagate AbortController.abort() to the AbortSignal in the main process?
Note: Electron remote does similir thing through ObjectRegistry.