Skip to content

Strand[R]

Handles a background strand created by spawn.

Fields

done @ Bool

Whether the strand has completed execution.

Methods

cancel()

Requests cancellation of the strand, causing a Canceled error to be raised if the strand is suspended and on all subsequent suspension attempts.

join() -> R

Waits until the strand completes and returns its result. If the strand terminates normally, returns the value returned by the function. If the strand exited with an error, this method re-raises it.

wait()

Waits until the strand completes. Unlike join(), this method does not return the strand's return value or re-raise any error. Use this when you only care that the strand finished, not what it returned.