oa::Channel

oa::Channel <T > — bounded MPMC channel (multiple-producer, multiple-consumer). Bounded ring buffer with blocking send/recv and non-blocking trySend/tryRecv. Supports graceful shutdown via close() which unblocks all waiters. usage: oa::Channel <oa ::Matrix> ch(16); // capacity 16 ch.send(tensor); // blocks if full auto t = ch.recv(); // blocks if empty, returns nullopt if closed ch.close(); // unblocks all waiters

Public Methods

void oa::Channel::Channel<T>(oa::I32 inCapacity)
void oa::Channel::close()
bool oa::Channel::isClosed()
oa::Optional<T> oa::Channel::recv()
bool oa::Channel::send(T inValue)
oa::I32 oa::Channel::size()
oa::Optional<T> oa::Channel::tryRecv()
bool oa::Channel::trySend(T inValue)

Public Method Documentation

void oa::Channel::Channel<T>( oa::I32 inCapacity )
No public source comment is attached to this declaration.

Parameters

inCapacity
oa::I32

Returns

void

The declared return value.

void oa::Channel::close()
No public source comment is attached to this declaration.

Returns

void

The declared return value.

bool oa::Channel::isClosed()
No public source comment is attached to this declaration.

Returns

bool

The declared return value.

oa::Optional<T> oa::Channel::recv()
No public source comment is attached to this declaration.

Returns

oa::Optional<T>

The declared return value.

bool oa::Channel::send( T inValue )
No public source comment is attached to this declaration.

Parameters

inValue
T

Returns

bool

The declared return value.

oa::I32 oa::Channel::size()
No public source comment is attached to this declaration.

Returns

oa::I32

The declared return value.

oa::Optional<T> oa::Channel::tryRecv()
No public source comment is attached to this declaration.

Returns

oa::Optional<T>

The declared return value.

bool oa::Channel::trySend( T inValue )
No public source comment is attached to this declaration.

Parameters

inValue
T

Returns

bool

The declared return value.