111 [[nodiscard]]
auto start() ->
bool override;
112 [[nodiscard]]
auto is_running() const noexcept ->
bool override;
113 void shutdown(
bool wait_for_completion = true) override;
119 [[nodiscard]] auto
submit(std::function<
void()> task)
120 -> std::future<
void> override;
124 std::function<
void()> task) -> std::future<
void> override;
149 -> std::shared_ptr<
kcenon::thread::thread_pool>;
Concrete implementation of thread_pool_interface.
void submit_internal(std::function< void()> task, job_priority priority)
Internal task submission with priority.
thread_pool_adapter(const thread_pool_config &config)
Construct adapter with configuration.
auto submit(std::function< void()> task) -> std::future< void > override
Submit a task for execution.
auto get_idle_worker_count() const -> std::size_t override
Get the number of idle workers.
auto get_underlying_pool() const -> std::shared_ptr< kcenon::thread::thread_pool >
Get the underlying thread pool.
auto get_thread_count() const -> std::size_t override
Get the current number of worker threads.
thread_pool_config config_
auto get_config() const noexcept -> const thread_pool_config &
Get the current configuration.
auto get_pending_task_count() const -> std::size_t override
Get the number of pending tasks in the queue.
void submit_fire_and_forget(std::function< void()> task) override
Submit a task without waiting for completion.
thread_pool_adapter(const thread_pool_adapter &)=delete
~thread_pool_adapter() override
Destructor.
thread_pool_adapter(thread_pool_adapter &&)=delete
thread_pool_adapter & operator=(thread_pool_adapter &&)=delete
auto submit_with_priority(job_priority priority, std::function< void()> task) -> std::future< void > override
Submit a task with a specific priority level.
void shutdown(bool wait_for_completion=true) override
Shutdown the thread pool.
auto start() -> bool override
Start the thread pool.
std::shared_ptr< kcenon::thread::thread_pool > pool_
auto is_running() const noexcept -> bool override
Check if the thread pool is running.
thread_pool_adapter & operator=(const thread_pool_adapter &)=delete
std::shared_mutex mutex
Mutex for thread-safe access.
job_priority
Priority levels for job scheduling.
Configuration options for the thread pool.
Abstract interface for thread pool operations.