Skip to content

Sender[T]

Sends values into a channel. As a Sink, it accepts put.

Senders are returned by channel.

Inherits from: std.Sink[T]

Methods

close …

Closes the sender, signaling the end of values to the receiver.

Later sends raise StateError. The receiver stops after it drains any buffered values; if error is given, it raises error instead of stopping.

Parameters

NameTypeDescription
error? Value Error for the receiver to raise.
:backtrace? inspect.Backtrace Backtrace to report with error.

Example

send.close()
send.close "boom"

put value

Sends a value, waiting while the channel's buffer is full.

Parameters

NameTypeDescription
value T Value to send.

Errors

Exception Condition
StateError The sender is closed
SinkStop The receiver is closed