Channel.tryReceive

ChannelStatus tryReceive(out T value) @trusted

Try to receive a value without blocking.

Parameters

valueOutput parameter to store the received value.

Returns

ChannelStatus.SUCCESS if a value was received,

ChannelStatus.WOULD_BLOCK if the channel is empty, ChannelStatus.CLOSED if the channel is closed and empty.