Re: [w3ctag/design-reviews] scheduler.postTask() API (#338)

Yes, the priority option acts as an override and wins over the priority from the signal, but the priority _remains fixed at that priority_, meaning controller.setPriority() won't change the priority for that task. In this example, that means the priority of that task will always be background. The invariant here is that specifying a fixed priority, whether or not a signal is provided, will cause that task to always remain at that priority. That's what I meant by the signal is downcast to an `AbortSignal` if a priority is provided.

This is mentioned in the [design doc](https://docs.google.com/document/d/1Apz-SD-pOagGeyWxIpgOi0ARNkrCrELhPdm18eeu9tw/edit#heading=h.nwu93s8w8l3o), but looks like it didn't make it into the explainer; I'll add this information and an example.

There are other options here, e.g. ignoring the priority option, throwing an error. The current approach seemed to enable additional use cases which is why we selected it, but we're open to suggestions/feedback.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/338#issuecomment-594323045

Received on Wednesday, 4 March 2020 04:40:39 UTC