Channel

Thread-safe typed data channel implementation.

The implementation supports multiple-reader-multiple-writer operation across multiple tasks in multiple threads.

Members

Functions

close
void close()

Closes the channel.

consumeAll
bool consumeAll(FixedRingBuffer!(T, buffer_size) dst)

Attempts to consume all elements currently in the queue.

consumeAll
bool consumeAll(FixedRingBuffer!(T, buffer_size) dst)

Attempts to consume all elements currently in the queue.

consumeOne
T consumeOne()

Consumes a single element off the queue.

put
void put(T item)

Enqueues an element.

tryConsumeOne
bool tryConsumeOne(T dst)

Attempts to consume a single element.

Manifest constants

bufferSize
enum bufferSize;
Undocumented in source.

Properties

bufferFill
size_t bufferFill [@property getter]

Returns the current count of items in the buffer.

empty
bool empty [@property getter]

Determines whether there is more data to read in a single-reader scenario.

Meta