Buffered channels are channels with an internal value buffer (represented internally as an array with positive size). They have the following semantics:
send, when the buffer is not full, appends the value to the buffer and success immediately.
send, when the buffer is full, suspends until some buffer slot is freed and assigned to this sender.
Create an Async.Source representing the send action of value x.
Create an Async.Source representing the send action of value x.
Note that each listener attached to and accepting an Unit value corresponds to x being sent once.
To create an Async.Source that sends the item exactly once regardless of listeners attached, wrap the send operation inside a gears.async.Future:
val sendOnce = Future(ch.send(x))
Attributes
Returns
an Async.Source that resolves with Right(()) when x is sent to the channel, or Left(Closed) if the channel is already closed. This source will perform a send operation every time a listener is attached to it, or every time it is Async$.awaited on.
An Async.Source corresponding to items being sent over the channel. Note that each listener attached to and accepting a Right value corresponds to one value received over the channel.
An Async.Source corresponding to items being sent over the channel. Note that each listener attached to and accepting a Right value corresponds to one value received over the channel.
To create an Async.Source that reads exactly one item regardless of listeners attached, wrap the read operation inside a gears.async.Future.