Channel
Definitions
def buffered(n: Int32): (Sender[t], Receiver[t]) \ Chan
SourceReturns a new buffered channel with capacity for n
elements.
def recv(receiver: Receiver[t]): t \ Chan + NonDet
SourceReceives a message from the given channel r
.
Blocks until a message is dequeued.
Sends the message m
on the given channel s
.
Blocks until the message is enqueued.
def timeout(d: Duration): Receiver[Unit] \ Chan + IO
SourceReturns a channel that receives the Unit
message after duration d
.
def unbuffered(): (Sender[t], Receiver[t]) \ Chan
SourceReturns a new unbuffered channel (i.e. a channel with zero capacity).
def unsafeSend(m: t, sender: Sender[t]): Unit \ Chan
SourceSends the message m
on the given channel s
.
Blocks until the message is enqueued.
Identical to send
but doesn't require Sendable
.
It is up to programmer to ensure that race conditions cannot arise due to concurrent access to m
.