LockedQueue

Locked queue for inter-thread communication. Support multiple writers, multiple readers. Blocks threads either when empty or full. @nogc once in use.

Constructors

this
this(size_t capacity)

Creates a locked queue with an initial capacity.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

capacity
size_t capacity()
clear
void clear()

Removes all locked queue items.

popBack
T popBack()

Pop an item from the back, block if queue is empty.

popFront
T popFront()

Pop an item from the front, block if queue is empty.

pushBack
void pushBack(T x)

Push an item to the back, block if queue is full.

pushFront
void pushFront(T x)

Push an item to the front, block if queue is full.

tryPopBack
bool tryPopBack(T result)

Tries to pop an item from the back immediately.

tryPopFront
bool tryPopFront(T result)

Tries to pop an item from the front immediately.

See Also

Meta