33class thread_pool_interface {
42 virtual std::future<void>
submit(std::function<
void()> task) = 0;
51 std::function<
void()> task,
52 std::chrono::milliseconds delay
92 std::future<void>
submit(std::function<
void()> task)
override;
94 std::function<
void()> task,
95 std::chrono::milliseconds delay
105 void stop(
bool wait_for_tasks =
true);
168 std::future<void>
submit_task(std::function<
void()> task);
177 std::function<
void()> task,
178 std::chrono::milliseconds delay
Basic thread pool implementation for standalone use.
size_t worker_count() const override
Get the number of worker threads.
void stop(bool wait_for_tasks=true)
Stop the thread pool.
bool is_running() const override
Check if the thread pool is running.
size_t completed_tasks() const
Get completed tasks count.
basic_thread_pool(size_t num_threads=0)
Construct with specified number of threads.
std::shared_ptr< impl > pimpl_
PIMPL pointer with intentional leak pattern.
std::future< void > submit_delayed(std::function< void()> task, std::chrono::milliseconds delay) override
Submit a task with delay.
size_t pending_tasks() const override
Get pending task count.
std::future< void > submit(std::function< void()> task) override
Submit a task to the thread pool.
Manager for thread system integration.
void set_thread_pool(std::shared_ptr< thread_pool_interface > pool)
Set the thread pool implementation.
std::future< void > submit_delayed_task(std::function< void()> task, std::chrono::milliseconds delay)
Submit a task with delay.
~thread_integration_manager()
static thread_integration_manager & instance()
Get the singleton instance.
std::shared_ptr< impl > pimpl_
PIMPL pointer with intentional leak pattern.
metrics get_metrics() const
Get current metrics.
std::future< void > submit_task(std::function< void()> task)
Submit a task to the thread pool.
std::shared_ptr< thread_pool_interface > get_thread_pool()
Get the current thread pool.
thread_integration_manager()
Interface for thread pool integration.
virtual size_t worker_count() const =0
Get the number of worker threads.
virtual std::future< void > submit(std::function< void()> task)=0
Submit a task to the thread pool.
virtual std::future< void > submit_delayed(std::function< void()> task, std::chrono::milliseconds delay)=0
Submit a task with delay.
virtual size_t pending_tasks() const =0
Get pending task count.
virtual ~thread_pool_interface()=default
virtual bool is_running() const =0
Check if the thread pool is running.