Re: [whatwg/dom] Request for a different type of example of abort steps (Issue #1031)

> I am guessing that one's abort steps could set a "stop doing things" flag, and one's overall algorithm's in-parallel steps could check that flag now-and-then

Yes, that sounds reasonable.

> it wouldn't need to do the promise rejection at that point because the "abort steps" (per abortcontroller-api-integration) take care of it)

Probably you want to delay the promise rejection until you've actually confirmed the abort went through. I.e. in such a flag-based approach you would not want to follow the template linked there, but instead queue a task from in parallel to reject the promise.

Otherwise you could, for example, have a race, where on the main thread you set the flag, but in parallel you've finished the operation, and so setting the flag does nothing. In that case you would not want to reject the promise.

-- 
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/1031#issuecomment-966411719

Received on Thursday, 11 November 2021 15:50:18 UTC