Skip to content

Commit fb4ca90

Browse files
fix: address code review comments
1 parent 28e8902 commit fb4ca90

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

design/mvp/Async.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,13 @@ into the host, there is only a `Subtask`.
283283
Based on this, the call stack when a component calls a host-defined import will
284284
be a call stack of the general form:
285285
```
286-
[Host caller] <- [Task] <- [Subtask+Task]* <- [Subtask] <- [Host callee]
286+
[Host]
287+
↓ host calls component export
288+
[Component Task]
289+
↓ component calls import implemented by another component's export 0..N times
290+
[Component Subtask <> Component Task]*
291+
↓ component calls import implemented by the host
292+
[Component Subtask <> Host task]
287293
```
288294
Here, the `<-` arrow represents the `supertask` relationship that is immutably
289295
established when first making the call. A paired `Subtask` and `Task` have the
@@ -742,7 +748,6 @@ The stackful ABI is currently gated by the 🚟 feature.
742748

743749
The async stackful export function signature for export `foo` (defined above
744750
in world `w`) is:
745-
746751
```wat
747752
;; async, no callback
748753
(func (param $s-ptr i32) (param $s-len i32))
@@ -752,7 +757,6 @@ The parameters work just like synchronous parameters.
752757

753758
There is no core function result because a callee [returns](#returning) their
754759
value by *calling* the *imported* `task.return` function which has signature:
755-
756760
```wat
757761
;; task.return
758762
(func (param $ret-ptr i32) (result $ret-len i32))
@@ -767,7 +771,6 @@ used.
767771

768772
The async stackless export function signature for export `foo` (defined above
769773
in world `w`) is:
770-
771774
```wat
772775
;; async, callback
773776
(func (param $s-ptr i32) (param $s-len i32) (result i32))
@@ -788,7 +791,6 @@ The `(result i32)` lets the core function return what it wants the runtime to do
788791

789792
When an async stackless function is exported, a companion "callback" function
790793
must also be exported with signature:
791-
792794
```wat
793795
(func (param i32 i32 i32) (result i32))
794796
```

0 commit comments

Comments
 (0)