Skip to content

Commit b5d1c47

Browse files
committed
CABI: refactor/simplify stream/future logic; fix DROPPED/CANCELLED delivery
1 parent e5ee0af commit b5d1c47

8 files changed

Lines changed: 1335 additions & 1335 deletions

File tree

design/mvp/CanonicalABI.md

Lines changed: 454 additions & 666 deletions
Large diffs are not rendered by default.

design/mvp/Concurrency.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ and writable ends of streams and futures can then be
600600
progress signals *completion* of a read or write (i.e., the bytes have already
601601
been copied into the buffer). Additionally, *readiness* (to perform a read or
602602
write in the future) can be queried and signalled by performing a `0`-length
603-
read or write (see the [Stream State] section in the Canonical ABI explainer
604-
for details).
603+
read or write (see the [Stream and Future State] section in the Canonical ABI
604+
explainer for details).
605605

606606
As a temporary limitation, if a `read` and `write` for a single stream or
607607
future occur from within the same component and the element type is a
@@ -619,8 +619,8 @@ without requiring an explicit `future` return type. Thus, a function like
619619
which point the caller receives the readable end of a `future` that, when
620620
successfully read, conveys the completion of a second event.
621621

622-
The [Stream State] and [Future State] sections describe the runtime state
623-
maintained for streams and futures by the Canonical ABI.
622+
The [Stream and Future State] section describes the runtime state maintained for
623+
streams and futures by the Canonical ABI.
624624

625625
### Stream Readiness
626626

@@ -1574,8 +1574,7 @@ the concurrency story:
15741574
[`ComponentInstance`]: CanonicalABI.md#component-instances
15751575
[`Thread`]: CanonicalABI.md#threads
15761576
[`Task`]: CanonicalABI.md#tasks
1577-
[Stream State]: CanonicalABI.md#stream-state
1578-
[Future State]: CanonicalABI.md#future-state
1577+
[Stream and Future State]: CanonicalABI.md#stream-and-future-state
15791578

15801579
[Binary Format]: Binary.md
15811580
[WIT]: WIT.md

design/mvp/Explainer.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ the buffer parameter is ignored.
20052005
If the return value is a `stream-result`, then the `progress` field indicates how
20062006
many `T` elements were read or written from the given buffer before the
20072007
`copy-result` was reached. For example, a return value of `{progress: 4,
2008-
result: dropped}` from a `stream<u32>.read` means that 32 bytes were copied
2008+
result: dropped}` from a `stream<u32>.read` means that 16 bytes were copied
20092009
into the given buffer before the writer end dropped the stream. The `cancelled`
20102010
case can only arise as the result of a call to `stream.cancel-{read,write}`.
20112011

@@ -3419,8 +3419,8 @@ For some use-case-focused, worked examples, see:
34193419
[`canon_waitable_set_drop`]: CanonicalABI.md#-canon-waitable-setdrop
34203420
[`canon_waitable_join`]: CanonicalABI.md#-canon-waitablejoin
34213421
[`canon_stream_new`]: CanonicalABI.md#-canon-streamfuturenew
3422-
[`canon_stream_read`]: CanonicalABI.md#-canon-streamreadwrite
3423-
[`canon_future_read`]: CanonicalABI.md#-canon-futurereadwrite
3422+
[`canon_stream_read`]: CanonicalABI.md#-canon-streamfuturereadwrite
3423+
[`canon_future_read`]: CanonicalABI.md#-canon-streamfuturereadwrite
34243424
[`canon_stream_cancel_read`]: CanonicalABI.md#-canon-streamfuturecancel-readwrite
34253425
[`canon_stream_drop_readable`]: CanonicalABI.md#-canon-streamfuturedrop-readablewritable
34263426
[`canon_subtask_cancel`]: CanonicalABI.md#-canon-subtaskcancel

0 commit comments

Comments
 (0)