You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ node index.js
a b
done
^C
$ electron index.js
a b
done
inside queue: a b
outside queue: a b
foo promise resolved
^Cnode_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGINT
The text was updated successfully, but these errors were encountered:
This is happening because DispatchQueue.main.sync enqueues the block onto the main NSRunLoop. Vanilla Node doesn't have a running NSRunLoop, whereas Electron is built to explicitly handle this case (see https://youtu.be/OPhb5GoV8Xk). You can sort of work around this by starting the RunLoop at the end of the function, though that causes it to never return. We should look into servicing the main run loop in a vanilla Node environment alongside libuv, as Electron does.
The text was updated successfully, but these errors were encountered: