template<typename T>
psl::spmc::consumer class final

provides multithread safe access into a psl::spmc::producer

This is the object to pass to the consumer threads, they have a minimal multithread safe API into the SPMC deque. The consumer is limited to viewing the state of the producer, and popping items from the front (if any are left).

member-functions

pop
Tries to pop an element from the front of the producer thread's deque.
public
size
public
ssize
public

Function documentation

template<typename T>
auto psl::spmc::consumer<T>::pop()

Brief

Tries to pop an element from the front of the producer thread's deque.

Details

If any items are left on the producer's deque, then this method will pop an item off of the front. Otherwise it will return a nullopt;

template<typename T>
auto psl::spmc::consumer<T>::size()

Details

Returns the current count of all elements in the producer.

template<typename T>
auto psl::spmc::consumer<T>::ssize()

Details

Returns the current count of all elements in the producer.