@@ -12,17 +12,27 @@ This spec formalizes three priorities to support scheduling tasks:
12
12
};
13
13
</pre >
14
14
15
- <dfn enum-value for =TaskPriority >user-blocking</dfn > is the highest priority, and is meant to be
16
- used for tasks that are blocking the user's ability to interact with the page, such as rendering the
17
- core experience or responding to user input.
18
-
19
- <dfn enum-value for =TaskPriority >user-visible</dfn > is the second highest priority, and is meant to
20
- be used for tasks that are observable to the user but not necessarily blocking user actions, such as
21
- updating secondary parts of the page. This is the default priority.
22
-
23
- <dfn enum-value for =TaskPriority >background</dfn > is the lowest priority, and is meant to be used
24
- for tasks that are not time-critical, such as background log processing or initializing certain
25
- third party libraries.
15
+ <dfn enum-value for =TaskPriority >user-blocking</dfn > is the highest priority, and it is meant for
16
+ tasks that should run as soon as possible, such that running them at a lower priority would degrade
17
+ user experience. This could be (chunked) work that is directly in response to user input, or
18
+ updating the in-viewport UI state, for example.
19
+ <br /><br />
20
+ Note that tasks scheduled with this priority will typically have a higher event loop priority
21
+ compared to other tasks, but they are not necessarily render-blocking. Work that needs to happen
22
+ immediately without interruption should typically be done synchronously &mdash ; but this can lead to
23
+ poor responsiveness if the work takes too long. "{{TaskPriority/user-blocking}}" tasks, on the other
24
+ hand, can be used to break up work and remain remain responsive to input and rendering, while
25
+ increasing the liklihood that the work finishes as soon as possible.
26
+
27
+ <dfn enum-value for =TaskPriority >user-visible</dfn > is the second highest priority, and it is meant
28
+ for tasks that will have useful side effects that are observable to the user, but either which are
29
+ not immediately observable or which are not essential to user experience. Tasks with this prioriy
30
+ are less important or less urgent than "{{TaskPriority/user-blocking}}" tasks. This is the default
31
+ priority.
32
+
33
+ <dfn enum-value for =TaskPriority >background</dfn > is the lowest priority, and it is meant to be used
34
+ for tasks that are not time-critical, such as background log or metrics processing or initializing
35
+ certain third party libraries.
26
36
27
37
Continuation priorities mirror task priorities, with an additional option to inherit the current
28
38
priority:
0 commit comments