eve.rt.channel.dynamic

Dynamic-resize channel for the EVE runtime.

A dynamic channel grows up to a configurable maximum capacity and shrinks back toward the initial capacity when items are consumed. This balances memory usage against burst tolerance.

Types 1

Dynamic-resize channel that grows on demand and shrinks on consume.

The buffer starts at initialCapacity and grows up to maxCapacity. When the buffer drains below a shrink threshold, it compacts back toward initialCapacity.

Fields
T[] buffer
size_t head
size_t tail
size_t count
size_t capacity_
size_t initialCapacity_
size_t maxCapacity_
bool closed_
Mutex mutex
Condition notEmpty
Condition notFull
Methods
void grow() @trusted nothrow
void shrink() @trusted nothrow
ChannelStatus blockingSend(T value) @trustedSend a value, blocking if at max capacity.
ChannelStatus trySend(T value) @trustedTry to send without blocking.
ChannelStatus blockingReceive(out T value) @trustedReceive a value, blocking if empty.
ChannelStatus tryReceive(out T value) @trustedTry to receive without blocking.
ChannelStatus trySend(T value, CancelToken token) @trusted
ChannelStatus tryReceive(out T value, CancelToken token) @trusted
ChannelStatus blockingSend(T value, CancelToken token) @trusted
ChannelStatus blockingReceive(out T value, CancelToken token) @trusted
void close() @trusted
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 maxCapacity)Construct a dynamic channel.