- From: James Browning <notifications@github.com>
- Date: Thu, 11 Feb 2021 01:11:30 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 11 February 2021 09:11:42 UTC
Currently communicating to a worker that work should be aborted is somewhat annoying. This is especially true for work that may be run in a synchronous loop as one can not simply send forward a `MessageChannel` that signals aborting, but rather you need to send a `SharedArrayBuffer` that can be synchronously read. I'd like to propose the ability to `.postMessage` an `AbortSignal` so that we can communicate aborting to workers in a consistent way to aborting on the main thread. Ideally this would support the synchronous case as well (e.g. calling `controller.abort()` from the original thread would synchronously update `signal.aborted` in the other thread so that compute loops can simply do `if (signal.aborted) { /* terminate work */ }`). If there's interest, I would be willing to create a PR for this. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/948
Received on Thursday, 11 February 2021 09:11:42 UTC