Receiver¶
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.
Receiver¶
An independently closable consumer endpoint for a local async channel.
try_receive¶
Returns a queued item, drained EOF, or an explicit Empty/Closed error without suspension.
receive¶
Waits for an item; None means that all senders closed and the queue has drained.
public fun receive(
token: Option<CancellationToken> = Option.None
): Future<Result<Option<T>, ChannelError>>
close¶
Closes this endpoint; dropping the last receiver rejects and wakes pending sends.