Fixed-capacity thread-safe queue with blocking push/pop – the bounded buffer between pulsatrix data-pipeline stages (campaign_exai_dl_library_data_pipeline). Not tied to any Dataset/DataLoader type; deliberately generic.
More...
#include <bounded_queue.hpp>
|
| | BoundedQueue (size_t capacity) |
| |
| void | push (T item) |
| | Pushes an item, blocking while the queue is full.
|
| |
| std::optional< T > | pop () |
| | Pops the next item, blocking while the queue is empty and not closed.
|
| |
| void | close () |
| | Signals no more pushes will occur; unblocks every waiting push()/pop().
|
| |
template<typename T>
class pulsatrix::BoundedQueue< T >
Fixed-capacity thread-safe queue with blocking push/pop – the bounded buffer between pulsatrix data-pipeline stages (campaign_exai_dl_library_data_pipeline). Not tied to any Dataset/DataLoader type; deliberately generic.
- Note
- This is pulsatrix's first concurrent code path (data_pipeline campaign, Risk Register: "Threading model correctness"). No production DataLoader path exercises this class yet in Phase 1 – DataLoader defaults to num_workers=0 (fully synchronous); wiring this into DataLoader's fetch/collate stages is a later, separately-tested mission (Decision Point 7).
◆ BoundedQueue()
◆ close()
Signals no more pushes will occur; unblocks every waiting push()/pop().
◆ pop()
Pops the next item, blocking while the queue is empty and not closed.
- Returns
- The next item, or std::nullopt once closed AND drained.
◆ push()
Pushes an item, blocking while the queue is full.
- Note
- A push after close() is silently dropped – close() means "no more producers", so a caller racing a push against its own close() call has a logic error, not something this queue can meaningfully recover from.
The documentation for this class was generated from the following file: