20#include <kcenon/common/patterns/result.h>
146 [[nodiscard]] virtual auto
is_enabled() const ->
bool {
return true; }
Represents an error in the thread system.
Represents a unit of work (task) to be executed, typically by a job queue.
Base interface for thread pool policies.
virtual auto on_enqueue(job &j) -> common::VoidResult=0
Called before a job is enqueued.
virtual ~pool_policy()=default
Virtual destructor for proper cleanup.
virtual void on_job_start(job &j)=0
Called when a worker starts executing a job.
virtual void on_job_complete(job &j, bool success, const std::exception *error=nullptr)=0
Called when a job completes (success or failure).
virtual auto get_name() const -> std::string=0
Gets the policy name for identification and logging.
virtual auto is_enabled() const -> bool
Checks if the policy is currently enabled.
virtual void set_enabled(bool enabled)
Enables or disables the policy.
Core threading foundation of the thread system library.