GrChannel

A pipe that allow synchronised communication between coroutines.

Constructors

this
this()

Buffer of size 1.

this
this(uint buffSize)

Fixed size buffer.

Members

Functions

receive
T receive()

Always check canReceive() before.

send
void send(T value)

Always check canSend() before.

setReceiverReady
void setReceiverReady()

Notify the senders that they can write to this channel because you are blocked on it.

Properties

canReceive
bool canReceive [@property getter]

You can receive whenever there is a value stored without being blocked.

canSend
bool canSend [@property getter]

On a channel of size 1, the sender is blocked until something tells him he is ready to receive the value.

capacity
uint capacity [@property getter]

Maximum number of values the channel can store

isEmpty
bool isEmpty [@property getter]

Is the channel empty ?

isFull
bool isFull [@property getter]

Is the channel full ?

size
uint size [@property getter]

Number of values the channel is currently storing

Variables

isOwned
bool isOwned;

The channel is active.

Meta