Skip to content

Commit 9d7f895

Browse files
committed
Explain more of wait/backpressure interaction
1 parent 2830ab4 commit 9d7f895

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

design/mvp/Async.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ call the `task.backpressure` built-in to set a "backpressure" flag that causes
221221
subsequent export calls to immediately return in the [starting](#starting)
222222
state without calling the component's Core WebAssembly code.
223223

224+
Once backpressure is enabled, the current task can [wait](#waiting) for
225+
existing tasks to finish and release their associated resources. Thus, a task
226+
can [wait](#waiting) with or without backpressure, depending on whether it
227+
wants to accept new accept new export calls while waiting or not.
228+
224229
See the [`canon_task_backpressure`] function and [`Task.enter`] method in the
225230
Canonical ABI explainer for the setting and implementation of backpressure.
226231

@@ -233,9 +238,9 @@ arguments and must instead call an imported [`task.start`] built-in to lower
233238
and receive its arguments.
234239

235240
The main reason to have `task.start` is so that an overloaded component can
236-
[wait](#waiting) and/or exert [backpressure](#backpressure) before accepting
237-
the arguments to an export call. See the [`canon_task_start`] function in the
238-
Canonical ABI explainer for more details.
241+
enable [backpressure](#backpressure) and then [wait](#waiting) for existing
242+
tasks to finish before the receiving the arguments to the current task. See the
243+
[`canon_task_start`] function in the Canonical ABI explainer for more details.
239244

240245
Before a task has called `task.start`, it is considered in the "starting"
241246
state. After calling `task.start`, the task is in a "started" state.

0 commit comments

Comments
 (0)