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
| Name | Type | Description |
|---|---|---|
error? |
Value |
Error for the receiver to raise. |
:backtrace? |
inspect.Backtrace |
Backtrace to report with error. |
Example
put value
Sends a value, waiting while the channel's buffer is full.
Parameters
| Name | Type | Description |
|---|---|---|
value |
T |
Value to send. |
Errors
| Exception | Condition |
|---|---|
StateError |
The sender is closed |
SinkStop |
The receiver is closed |