Sink
A channel sink, which can be used to send values to the channel. See Channel for more details.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Channel[T]
Members list
Type members
Classlikes
The clause passed to select, created using sendClause.
The clause passed to select, created using sendClause.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SelectClause[Unit]class Objecttrait Matchableclass AnyShow all
Holds the result of a sendClause that was selected during a call to select.
Holds the result of a sendClause that was selected during a call to select.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SelectResult[Unit]class Objecttrait Matchableclass AnyShow all
Value members
Abstract methods
Concrete methods
Close the channel, indicating that no more values will be sent. Doesn't throw exceptions when the channel is closed, but returns a value.
Close the channel, indicating that no more values will be sent. Doesn't throw exceptions when the channel is closed, but returns a value.
Any values that are already buffered will be delivered. Any send operations that are in progress will complete normally, when a receiver arrives. Any pending receive operations will complete with a channel closed result.
Subsequent send operations will throw ChannelClosedException.
For a variant which doesn't throw exceptions when the channel is closed, use doneOrClosed.
Attributes
- Throws
-
ChannelClosedException
If the channel is already closed.
Close the channel, indicating that no more values will be sent. Doesn't throw exceptions when the channel is closed, but returns a value.
Close the channel, indicating that no more values will be sent. Doesn't throw exceptions when the channel is closed, but returns a value.
Any values that are already buffered will be delivered. Any send operations that are in progress will complete normally, when a receiver arrives. Any pending receive operations will complete with a channel closed result.
Subsequent sendOrClosed operations will return ChannelClosed.
For a variant which throws exceptions when the channel is closed, use done.
Attributes
- Returns
-
Either
()
, or ChannelClosed, when the channel is already closed.
Close the channel, indicating an error.
Close the channel, indicating an error.
Any values that are already buffered won't be delivered. Any send or receive operations that are in progress will complete with a channel closed result.
Subsequent send and Source.receive operations will throw ChannelClosedException.
For a variant which doesn't throw exceptions when the channel is closed, use errorOrClosed.
Value parameters
- reason
-
The reason of the error.
Attributes
- Throws
-
ChannelClosedException
If the channel is already closed.
Close the channel, indicating an error.
Close the channel, indicating an error.
Any values that are already buffered won't be delivered. Any send or receive operations that are in progress will complete with a channel closed result.
Subsequent sendOrClosed and Source.receiveOrClosed operations will return ChannelClosed.
For a variant which throws exceptions when the channel is closed, use error.
Value parameters
- reason
-
The reason of the error.
Attributes
- Returns
-
Either
()
, or ChannelClosed, when the channel is already closed.
Attributes
- Returns
-
true
if no more values can be sent to this channel; Sink.sendOrClosed will return ChannelClosed. When closed for send, receiving using Source.receive might still be possible, if the channel is done, and not in an error. This can be verified using isClosedForReceive.
Attributes
- Returns
-
Some
if no more values can be sent to this channel; Sink.sendOrClosed will return ChannelClosed. When closed for send, receiving using Source.receive might still be possible, if the channel is done, and not in an error. This can be verified using isClosedForReceive.
Send a value to the channel. For a variant which doesn't throw exceptions when the channel is closed, use sendOrClosed.
Send a value to the channel. For a variant which doesn't throw exceptions when the channel is closed, use sendOrClosed.
Value parameters
- t
-
The value to send. Not
null
.
Attributes
- Throws
-
ChannelClosedException
If the channel is closed (done or in error).
Send a value to the channel. For a variant which throws exceptions when the channel is closed, use send.
Send a value to the channel. For a variant which throws exceptions when the channel is closed, use send.
Value parameters
- t
-
The value to send. Not
null
.
Attributes
- Returns
-
Either
()
, or ChannelClosed, when the channel is closed.