Sink

ox.channels.Sink
trait Sink[-T]

A channel sink, which can be used to send values to the channel. See Channel for more details.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Channel[T]

Members list

Type members

Classlikes

case class Send extends SelectClause[Unit]

The clause passed to select, created using sendClause.

The clause passed to select, created using sendClause.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SelectClause[Unit]
class Object
trait Matchable
class Any
Show all
case class Sent extends SelectResult[Unit]

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 Serializable
trait Product
trait Equals
trait SelectResult[Unit]
class Object
trait Matchable
class Any
Show all

Value members

Abstract methods

protected def delegate: Sink[Any]

Concrete methods

def done(): Unit | ChannelClosed

Close the channel, indicating that no more elements will be sent. Doesn't throw exceptions when the channel is closed, but returns a value.

Close the channel, indicating that no more elements will be sent. Doesn't throw exceptions when the channel is closed, but returns a value.

Any elements 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 return ChannelClosed.

Attributes

Returns

Either (), or ChannelClosed, when the channel is already closed.

def error(reason: Throwable): Unit | ChannelClosed

Close the channel, indicating an error.

Close the channel, indicating an error.

Any elements 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 return ChannelClosed..

Value parameters

reason

The reason of the error.

Attributes

Returns

Either (), or ChannelClosed, when the channel is already closed.

def isClosedForSend: Boolean

Attributes

Returns

true if no more values can be sent to this channel; Sink.send 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.send 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.

def send(t: T): Unit | ChannelClosed

Send a value to the channel. To throw an exception when the channel is closed, use orThrow.

Send a value to the channel. To throw an exception when the channel is closed, use orThrow.

Value parameters

t

The value to send. Not null.

Attributes

Returns

Either (), or ChannelClosed, when the channel is closed.

def sendClause(t: T): Send

Create a clause which can be used in select. The clause will send the given value to the current channel, and return () as the clause's result.

Create a clause which can be used in select. The clause will send the given value to the current channel, and return () as the clause's result.

Attributes