2.5.6. Channel

TODO.

2.5.6.1. Instruction

target = channel.read op1 [channel::Read]
Target:any
Operator 1:ref<channel<*>>

Returns the next channel item from the channel referenced by op1. If the channel is empty, the instruction blocks until an item becomes available.

target = channel.read_try op1 [channel::ReadTry]
Target:any
Operator 1:ref<channel<*>>

Returns the next channel item from the channel referenced by op1. If the channel is empty, the instruction raises a WouldBlock exception.

target = channel.size op1 [channel::Size]
Target:int<64>
Operator 1:ref<channel<*>>

Returns the current number of items in the channel referenced by op1.

channel.write op1 op2 [channel::Write]
Operator 1:ref<channel<*>>
Operator 2:any

Writes an item into the channel referenced by op1. If the channel is full, the instruction blocks until a slot becomes available.

channel.write_try op1 op2 [channel::WriteTry]
Operator 1:ref<channel<*>>
Operator 2:any

Writes an item into the channel referenced by op1. If the channel is full, the instruction raises a WouldBlock exception.