|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Abstract interface for task execution systems. More...
#include <executor_interface.h>


Public Member Functions | |
| virtual | ~IExecutor ()=default |
| virtual Result< std::future< void > > | execute (std::unique_ptr< IJob > &&job)=0 |
| Execute a job with Result-based error handling. | |
| virtual Result< std::future< void > > | execute_delayed (std::unique_ptr< IJob > &&job, std::chrono::milliseconds delay)=0 |
| Execute a job with delay. | |
| virtual size_t | worker_count () const =0 |
| Get the number of worker threads. | |
| virtual bool | is_running () const =0 |
| Check if the executor is running. | |
| virtual size_t | pending_tasks () const =0 |
| Get the number of pending tasks. | |
| virtual void | shutdown (bool wait_for_completion=true)=0 |
| Shutdown the executor gracefully. | |
| virtual | ~IExecutor ()=default |
| virtual Result< std::future< void > > | execute (std::unique_ptr< IJob > &&job)=0 |
| Execute a job with Result-based error handling. | |
| virtual Result< std::future< void > > | execute_delayed (std::unique_ptr< IJob > &&job, std::chrono::milliseconds delay)=0 |
| Execute a job with delay. | |
| virtual size_t | worker_count () const =0 |
| Get the number of worker threads. | |
| virtual bool | is_running () const =0 |
| Check if the executor is running. | |
| virtual size_t | pending_tasks () const =0 |
| Get the number of pending tasks. | |
| virtual void | shutdown (bool wait_for_completion=true)=0 |
| Shutdown the executor gracefully. | |
Abstract interface for task execution systems.
This interface defines the contract for any task executor implementation, allowing modules to work with different threading backends without direct dependencies.
Extended with job-based execution support for better control and testability.
Definition at line 80 of file executor.cppm.
|
virtualdefault |
|
exportvirtualdefault |
|
pure virtual |
Execute a job with Result-based error handling.
| job | The job to execute |
Job-based execution provides better control and testability
Implemented in mock_executor.
Referenced by process_data_batch().

|
exportpure virtual |
Execute a job with Result-based error handling.
Implemented in mock_executor.
|
pure virtual |
Execute a job with delay.
| job | The job to execute |
| delay | The delay before execution |
Implemented in mock_executor.
|
exportpure virtual |
Execute a job with delay.
Implemented in mock_executor.
|
pure virtual |
Check if the executor is running.
Implemented in mock_executor.
|
exportpure virtual |
Check if the executor is running.
Implemented in mock_executor.
|
pure virtual |
Get the number of pending tasks.
Implemented in mock_executor.
|
exportpure virtual |
Get the number of pending tasks.
Implemented in mock_executor.
|
pure virtual |
Shutdown the executor gracefully.
| wait_for_completion | Wait for all pending tasks to complete |
Implemented in mock_executor.
|
exportpure virtual |
Shutdown the executor gracefully.
Implemented in mock_executor.
|
pure virtual |
Get the number of worker threads.
Implemented in mock_executor.
Referenced by process_data_batch().

|
exportpure virtual |
Get the number of worker threads.
Implemented in mock_executor.