diff --git a/imports.md b/imports.md
index 1ae5b12..23ba901 100644
--- a/imports.md
+++ b/imports.md
@@ -132,12 +132,15 @@ use the subscribe
function to obtain a po
for using
wasi:io/poll
.
resource output-stream
An output bytestream.
-output-stream
s are non-blocking to the extent practical on
+output-stream
s are non-blocking to the extent practical on
underlying platforms. Except where specified otherwise, I/O operations also
always return promptly, after the number of bytes that can be written
promptly, which could even be zero. To wait for the stream to be ready to
accept data, the subscribe
function to obtain a pollable
which can be
-polled for using wasi:io/poll
.
+polled for using wasi:io/poll
.
output-stream
while there's still an active write in
+progress may trap. Before dropping the stream, be sure to either fully
+flush or cancel your writes.[method]input-stream.read: func
Perform a non-blocking read from the stream.
@@ -418,3 +421,16 @@ is ready for reading, before performing thesplice
.
u64
, stream-error
>[method]output-stream.cancel: func
Initiate cancellation of any pending or in-progress writes.
+This is an asynchronous operation. Use subscribe
to wait for the
+cancellation to finish. Dropping the stream while the cancellation
+is in progress may trap.
While the cancellation is in progress, all other operations on this
+stream respond as though the stream is currently not available for
+I/O. (e.g. check-write
returns 0). After cancellation has completed,
+all operations return as though the stream is closed.
self
: borrow<output-stream
>