31class IThreadPool :
public IExecutor {
187 size_t queue_capacity = 0) = 0;
Result type for error handling with member function support.
Interface for modules that provide thread pool implementations.
virtual ~IThreadPoolProvider()=default
virtual Result< std::shared_ptr< IThreadPool > > create_thread_pool(size_t worker_count, size_t queue_capacity=0)=0
Create a new thread pool with specific configuration.
virtual std::shared_ptr< IThreadPool > get_thread_pool()=0
Get the default thread pool instance.
virtual bool is_queue_full() const =0
Check if the queue is full.
virtual ~IThreadPool()=default
virtual VoidResult resume()=0
Resume task processing.
virtual size_t completed_tasks() const
Get total number of completed tasks.
virtual size_t idle_workers() const =0
Get the number of idle workers.
virtual size_t active_tasks() const =0
Get the number of active (executing) tasks.
virtual size_t clear_pending_tasks()=0
Clear all pending tasks.
virtual size_t min_workers() const
Get the minimum number of worker threads.
virtual size_t failed_tasks() const
Get total number of failed tasks.
virtual VoidResult stop(bool wait_for_completion=true)=0
Stop the thread pool.
virtual size_t get_queue_capacity() const =0
Get the current queue capacity.
virtual VoidResult start()=0
Start the thread pool.
virtual size_t max_workers() const
Get the maximum number of worker threads.
virtual VoidResult pause()=0
Pause task processing.
virtual VoidResult set_queue_capacity(size_t capacity)=0
Set the maximum queue capacity.
virtual VoidResult resize(size_t new_size)=0
Resize the thread pool.
virtual bool is_paused() const =0
Check if the pool is paused.
Executor interfaces for task submission and management.
std::function< std::shared_ptr< IThreadPool >(size_t worker_count)> ThreadPoolFactory
Factory function type for creating thread pool instances.
Umbrella header for Result<T> type and related utilities.