Skip to content

Commit 42f10ac

Browse files
committed
Add 'stream' type
1 parent 225e862 commit 42f10ac

File tree

3 files changed

+367
-44
lines changed

3 files changed

+367
-44
lines changed

design/mvp/Async.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Thus, backpressure combined with the partitioning of low-level state provided
107107
by the Component Model enables sync and async code to interoperate while
108108
preserving the expectations of both.
109109

110+
TODO: describe
110111
[TODO](#todo): `future` and `stream` types that can be used in function
111112
signatures will be added next.
112113

@@ -445,21 +446,24 @@ For now, this remains a [TODO](#todo) and validation will reject `async`-lifted
445446

446447
## TODO
447448

448-
Native async support is being proposed in progressive chunks. The following
449-
features will be added in future chunks to complete "async" in Preview 3:
450-
* `future`/`stream`/`error`: add for use in function types for finer-grained
451-
concurrency
452-
* `subtask.cancel`: allow a supertask to signal to a subtask that its result is
453-
no longer wanted and to please wrap it up promptly
454-
* allow "tail-calling" a subtask so that the current wasm instance can be torn
455-
down eagerly
456-
* `task.index`+`task.wake`: allow tasks in the same instance to wait on and
457-
wake each other (async condvar-style)
449+
Native async support is being proposed incrementally. The following features
450+
will be added in future chunks roughly in the order list to complete the full
451+
"async" story:
458452
* `nonblocking` function type attribute: allow a function to declare in its
459453
type that it will not transitively do anything blocking
454+
* add `error` type that can be included when closing a stream/future
455+
* add `future` type (maybe integrate with `lower async` to enable pipelines?)
456+
* define what `async` means for `start` functions
457+
* `task.index`+`task.wake`: allow tasks in the same instance to wait on and
458+
wake each other (async condvar-style)
459+
* `subtask.cancel`: allow a supertask to signal to a subtask that its result is
460+
no longer wanted and to please wrap it up promptly
461+
* `stream.lull` built-in that says "no more elements are coming for a while"
462+
* built-in to "tail-call" a subtask so that the current wasm instance can be torn
463+
down eagerly while preserving "structured concurrency"
460464
* `recursive` function type attribute: allow a function to be reentered
461-
recursively (instead of trapping)
462-
* enable `async` `start` functions
465+
recursively (instead of trapping) for the benefit of donut wrapping
466+
* allow pipelining `stream.read`/`write` calls/buffers
463467
* integrate with `shared`: define how to lift and lower functions `async` *and*
464468
`shared`
465469

0 commit comments

Comments
 (0)