eve.rt.channel.unbounded

Unbounded channel for the EVE runtime.

An unbounded channel grows without limit (bounded only by a configurable memory limit). It never blocks on send -- backpressure is applied by checking the memory budget before each send. Receivers block when empty.

Use this when the producer is faster than the consumer but you want to absorb bursts without dropping messages. For fixed-capacity channels, use Channel.

Types 1

Unbounded channel that grows on demand.

Sends never block -- the internal buffer grows as needed. A configurable memory limit provides backpressure: when the buffer exceeds the limit, trySend fails with ChannelErrorReason.WOULD_BLOCK and blockingSend blocks until capacity is available.

Receivers block when the channel is empty, same as Channel.

Methods
ChannelStatus blockingSend(T value) @trustedSend a value, blocking if the memory limit is reached.
ChannelStatus trySend(T value) @trustedTry to send without blocking.
ChannelResult!T blockingReceive() @trustedReceive a value, blocking if empty.
ChannelResult!T tryReceive() @trustedTry to receive without blocking.
ChannelStatus trySend(T value, CancelToken token) @trusted
ChannelStatus blockingSend(T value, CancelToken token) @trusted
void close() @trustedClose the channel, preventing further sends.
bool isClosed() @property @trusted
size_t length() @property @trusted
size_t capacity() @property const pure @safe nothrow @nogc
bool empty() @property @trusted
Constructors
this(size_t initialCapacity, size_t memoryLimit = 0)Construct an unbounded channel with an initial capacity and memory limit.