Skip to content

Commit 403098c

Browse files
chore: various async fixes
This comit adds some fixes/rewordings for the async sections. Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
1 parent b142e20 commit 403098c

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

design/mvp/Async.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,23 @@ interface filesystem {
186186
}
187187
}
188188
```
189-
a bindings generator in a language with `async` would only emit `async`
190-
functions for `read` and `fetch`. Since in many languages `new` expressions
191-
cannot be async, there is no `async constructor`. Use cases requiring
192-
asynchronous construction can instead use `static async` functions, similar to
193-
`from-stream` in this example.
189+
A bindings generator processing the above WIT for a language with `async` would
190+
only emit `async` functions for `read` and `from-stream`.
194191

192+
Since in many languages `new` expressions cannot be async, there is no
193+
`async constructor`. Use cases requiring asynchronous construction can instead
194+
use `static async` functions, similar to `from-stream` in this example.
195195

196196
### Task
197197

198198
Every time a lifted function is called (e.g., when a component's export is
199199
called by the outside world), a new **task** is created that logically contains
200200
all the transitive control-flow state of the export call and will be destroyed
201-
when the export call finishes. When all of a component's exports are lifted
202-
synchronously, there will be at most one task alive at any one time. However,
203-
when a component exports asynchronously-lifted functions, there can be multiple
204-
tasks alive at once.
201+
when the export call finishes.
202+
203+
When all of a component's exports are lifted synchronously, there will be at most one
204+
task alive at any one time. However, when a component exports asynchronously-lifted
205+
functions, there can be multiple tasks alive at once.
205206

206207
In the Canonical ABI explainer, a "task" is represented with the Python
207208
[`Task`] class. A new `Task` object is created (by [`canon_lift`]) each time

0 commit comments

Comments
 (0)