Skip to content

Commit 2cf3e4b

Browse files
refactor: structured concurrency section
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
1 parent 403098c commit 2cf3e4b

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

design/mvp/Async.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,19 @@ in the Canonical ABI explainer.
269269
### Structured concurrency
270270

271271
Calling *into* a component creates a `Task` to track ABI state related to the
272-
*callee* (like "number of outstanding borrows"). Calling *out* of a component
273-
creates a `Subtask` to track ABI state related to the *caller* (like "which
274-
handles have been lent"). When one component calls another, there is thus a
275-
`Subtask`+`Task` pair that collectively maintains the overall state of the call
276-
and enforces that both components uphold their end of the ABI contract. But
277-
when the host calls into a component, there is only a `Task` and,
278-
symmetrically, when a component calls into the host, there is only a `Subtask`.
279-
280-
Based on this, the call stack at any point in time when a component calls a
281-
host-defined import will have a callstack of the general form:
272+
*callee* (like "number of outstanding borrows").
273+
274+
Calling *out* of a component creates a `Subtask` to track ABI state related to
275+
the *caller* (like "which handles have been lent").
276+
277+
When one component calls another, there is thus a `Subtask`+`Task` pair that
278+
collectively maintains the overall state of the call and enforces that both
279+
components uphold their end of the ABI contract. But when the host calls into
280+
a component, there is only a `Task` and, symmetrically, when a component calls
281+
into the host, there is only a `Subtask`.
282+
283+
Based on this, the call stack for a component to host-defined import will be of
284+
the general form:
282285
```
283286
[Host caller] <- [Task] <- [Subtask+Task]* <- [Subtask] <- [Host callee]
284287
```

0 commit comments

Comments
 (0)