46 virtual std::string
get_name()
const {
return "unnamed_job"; }
97 std::unique_ptr<IJob>&& job,
98 std::chrono::milliseconds delay) = 0;
124 virtual void shutdown(
bool wait_for_completion =
true) = 0;
Result type for error handling with member function support.
Interface for modules that provide executor implementations.
virtual ~IExecutorProvider()=default
virtual std::shared_ptr< IExecutor > create_executor(size_t worker_count)=0
Create a new executor with specific configuration.
virtual std::shared_ptr< IExecutor > get_executor()=0
Get the default executor instance.
virtual void shutdown(bool wait_for_completion=true)=0
Shutdown the executor gracefully.
virtual size_t worker_count() const =0
Get the number of worker threads.
virtual Result< std::future< void > > execute_delayed(std::unique_ptr< IJob > &&job, std::chrono::milliseconds delay)=0
Execute a job with delay.
virtual bool is_running() const =0
Check if the executor is running.
virtual Result< std::future< void > > execute(std::unique_ptr< IJob > &&job)=0
Execute a job with Result-based error handling.
virtual size_t pending_tasks() const =0
Get the number of pending tasks.
virtual ~IExecutor()=default
virtual VoidResult execute()=0
Execute the job.
virtual int get_priority() const
Get the priority of the job (higher = more important)
virtual std::string get_name() const
Get the name of the job (for logging/debugging)
std::function< std::shared_ptr< IExecutor >()> ExecutorFactory
Factory function type for creating executor instances.
Umbrella header for Result<T> type and related utilities.