SharedReceiver¶
Import: import system.task;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
SharedReceiver¶
A shared consumer; queued values remain available after the last producer closes.
clone¶
Creates an independently closable consumer on the same queue.
try_receive¶
Attempts one receive, distinguishing Empty, closed endpoints, and drained EOF.
receive¶
Waits for a value or drained EOF using cross-worker notifications.
public fun receive(
token: Option<CancellationToken> = Option.None
): Future<Result<Option<T>, ChannelError>>
close¶
Closes this endpoint; the last consumer releases queued values and wakes blocked sends.