Skip to content

Commit

Permalink
Add 'stream' type
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner committed Oct 2, 2024
1 parent cef5c99 commit 17e03e2
Show file tree
Hide file tree
Showing 3 changed files with 922 additions and 103 deletions.
28 changes: 16 additions & 12 deletions design/mvp/Async.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,21 +419,25 @@ For now, this remains a [TODO](#todo) and validation will reject `async`-lifted

## TODO

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

Expand Down
Loading

0 comments on commit 17e03e2

Please sign in to comment.