Channel
0.40.0
Definitions
def
buffered
[rt]
(
rc :
Region[r]
n :
Int32
)
: (Sender[t, r], Receiver[t, r])
\ r
def
recv
[tr]
(
receiver :
Receiver[t, r]
)
: t
\ r
Receives a message from the given channel r
.
Blocks until a message is dequeued.
def
send
[tr]
(
m :
t
sender :
Sender[t, r]
)
: Unit
\ r
with
Sendable[t]
Sends the message m
on the given channel s
.
Blocks until the message is enqueued.
def
timeout
[r]
(
rc :
Region[r]
d :
Duration
)
: Receiver[Unit, r]
\ IO
Returns a channel that receives the Unit
message after duration d
.
def
unbuffered
[rt]
(
rc :
Region[r]
)
: (Sender[t, r], Receiver[t, r])
\ r
Returns a new unbuffered channel (i.e. a channel with zero capacity).
def
unsafeSend
[tr]
(
m :
t
sender :
Sender[t, r]
)
: Unit
\ r
Sends 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
.