Interrupt Web Worker or Python
Opened this issue · 1 comments
stefnotch commented
When a computation takes very long, it should be possible to stop it. I'd prefer to not have to .terminate()
the web worker for that.
Relevant issues
- pyodide/pyodide#237 (Threading support)
- emscripten-core/emscripten#3494 (Add support for simultaneously using dynamic linking + pthreads)
- https://bugzilla.mozilla.org/show_bug.cgi?id=1389458 ([meta] Implement WebAssembly threads proposal)
- pyodide/pyodide#676 (Interrupting execution)
- pyodide/pyodide#245 (Asyncio support)
- pyodide/pyodide@a012a66 (interrupt package)
stefnotch commented
Added the pyodide.setInterruptBuffer API. This can be used to set a SharedArrayBuffer to be the keyboard interupt buffer. If Pyodide is running on a webworker, the main thread can signal to the webworker that it should raise a KeyboardInterrupt by writing to the interrupt buffer
-- #17