Quick Reference Cheat Sheet¶
This page provides a quick lookup for common headers, template declarations, methods, compilation flags, and usage snippets.
Headers & Includes¶
#include "siddiqsoft/simple_worker.hpp" // Single-threaded worker
#include "siddiqsoft/simple_pool.hpp" // Multi-threaded shared-queue pool
#include "siddiqsoft/roundrobin_pool.hpp" // Multi-threaded per-thread queue pool
#include "siddiqsoft/periodic_worker.hpp" // Periodic timer executor
Component Overview Table¶
| Class | Template Signature | Thread Count | Queue Structure | Use Case |
|---|---|---|---|---|
simple_worker |
simple_worker<T, Priority = 0> |
1 | Single std::deque |
Sequential async background task |
simple_pool |
simple_pool<T, Threads = 0> |
N (hardware_concurrency) |
Single std::deque |
Parallel execution with shared queue |
roundrobin_pool |
roundrobin_pool<T, Threads = 0> |
N (hardware_concurrency) |
Per-thread std::deque |
Parallel execution with reduced lock contention |
periodic_worker |
periodic_worker<Priority = 0> |
1 | N/A (loop) | Recurring interval task |
Common Operations¶
Queueing Tasks¶
Graceful Worker Shutdown¶
Diagnostics & Telemetry¶
#include <nlohmann/json.hpp>
// Obtain JSON snapshot (itemsSize, itemsQueued, itemsPopped, etc.)
nlohmann::json info = worker.to_json();
std::println(info.dump(2));