|
Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
|
Abstract base class for thread pool backends. More...
#include <thread_backend.h>


Public Member Functions | |
| virtual | ~thread_backend ()=default |
| virtual common::VoidResult | initialize ()=0 |
| Initialize the thread backend. | |
| virtual common::VoidResult | shutdown ()=0 |
| Shutdown the thread backend gracefully. | |
| virtual bool | is_initialized () const =0 |
| Check if backend is initialized. | |
| virtual common::VoidResult | execute (std::function< void()> task)=0 |
| Execute a task (fire-and-forget) | |
| virtual void | wait_for_completion ()=0 |
| Wait for all pending tasks to complete. | |
| virtual bool | wait_for_completion_timeout (std::chrono::milliseconds timeout)=0 |
| Wait for completion with timeout. | |
| virtual std::size_t | worker_count () const =0 |
| Get number of worker threads. | |
| virtual std::size_t | queue_size () const =0 |
| Get current queue size. | |
| virtual bool | is_idle () const =0 |
| Check if thread pool is idle. | |
Abstract base class for thread pool backends.
All thread backends (system, fallback, null) must implement this interface. This enables runtime polymorphism and eliminates conditional compilation.
Definition at line 39 of file thread_backend.h.
|
virtualdefault |
|
pure virtual |
Execute a task (fire-and-forget)
| task | Task to execute |
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Initialize the thread backend.
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Check if thread pool is idle.
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Check if backend is initialized.
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Get current queue size.
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Shutdown the thread backend gracefully.
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Wait for all pending tasks to complete.
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Wait for completion with timeout.
| timeout | Maximum wait time |
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.
|
pure virtual |
Get number of worker threads.
Implemented in database::integrated::adapters::backends::fallback_thread_backend, and database::integrated::adapters::backends::null_thread_backend.