Skip to content

Commit 6ab2bc9

Browse files
committed
Clarify wording in Async.md concerning the writable end
1 parent 1aff728 commit 6ab2bc9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

design/mvp/Async.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,18 @@ attempts to exit.
211211
### Streams and Futures
212212

213213
Streams and Futures have two "ends": a *readable end* and *writable end*. When
214-
*consuming* a `stream` or `future` value as a parameter (of an export call
215-
with a `stream` or `future` somewhere in the parameter types) or result (of an
214+
*consuming* a `stream` or `future` value as a parameter (of an export call with
215+
a `stream` or `future` somewhere in the parameter types) or result (of an
216216
import call with a `stream` or `future` somewhere in the result type), the
217217
receiver always gets *unique ownership* of the *readable end* of the `stream`
218218
or `future`. When *producing* a `stream` or `future` value as a parameter (of
219219
an import call) or result (of an export call), the producer can either
220-
*transfer ownership* of a readable end it has already received or it can
221-
create a fresh writable end (via `stream.new` or `future.new`) and lift this
222-
writable end (maintaining ownership of the writable end, but creating a fresh
223-
readable end for the receiver). To maintain the invariant that readable ends
224-
are unique, a writable end can be lifted at most once, trapping otherwise.
220+
*transfer ownership* of a readable end it has already received or it can create
221+
a fresh writable end (via `stream.new` or `future.new`) and then lift this
222+
writable end to create a fresh readable end in the consumer while maintaining
223+
ownership of the writable end in the producer. To maintain the invariant that
224+
readable ends are unique, a writable end can be lifted at most once, trapping
225+
otherwise.
225226

226227
Based on this, `stream<T>` and `future<T>` values can be passed between
227228
functions as if they were synchronous `list<T>` and `T` values, resp. For

0 commit comments

Comments
 (0)