Skip to content

Stream[R, I, O]

A Strand with channel-backed input and output, created by stream.

Its iterator re-raises a strand error after draining output; its sink reports ordinary shutdown after input closes.

Inherits from: Iterable[I], Sinkable[O]

Fields

done @ Bool [get]

Whether the strand has completed execution.

Methods

cancel()

Cancels the strand, as Strand.cancel does.

join() -> R

Closes both channels, then waits for the strand to complete and returns its result.

If the strand exited with an error, re-raises it. Closing the channels first keeps the wait from deadlocking on a strand that is waiting for more input or for its output to be read.

wait()

Waits for the strand to complete. Unlike join, this does not close the channels, return the strand's result, or re-raise its error.