9 template <
typename job_type>
11 std::vector<job_type> types,
12 const bool& use_time_tag,
15 , use_time_tag_(use_time_tag)
16 , types_(
std::move(types))
22 template <
typename job_type>
27 template <
typename job_type>
34 template <
typename job_type>
40 template <
typename job_type>
46 template <
typename job_type>
52 template <
typename job_type>
60 return !job_queue_->empty(types_);
63 template <
typename job_type>
72 auto job_result = job_queue_->dequeue(types_);
73 if (job_result.is_err())
78 auto job = std::move(job_result.value());
A typed job queue with priority aging support, based on policy_queue.
A thread-safe job queue for managing and dispatching work items.
Represents a unit of work (task) to be executed, typically by a job queue.
virtual auto do_work(void) -> common::VoidResult
The core task execution method to be overridden by derived classes.
A foundational class for implementing custom worker threads.
Context object that provides access to optional services.
Typed thread worker template.
auto do_work() -> common::VoidResult override
Executes pending work by processing one job at a time.
auto set_aging_job_queue(std::shared_ptr< aging_typed_job_queue_t< job_type > > job_queue) -> void
Assigns a priority job queue to this worker.
auto should_continue_work() const -> bool override
Determines if there is any pending work for this worker.
typed_thread_worker_t(std::vector< job_type > types=get_all_job_types(), const bool &use_time_tag=true, const thread_context &context=thread_context())
Constructs a new typed_thread_worker_t object.
virtual ~typed_thread_worker_t(void)
Virtual destructor for the typed_thread_worker_t class.
auto get_context(void) const -> const thread_context &
Gets the thread context for this worker.
auto set_context(const thread_context &context) -> void
Sets the thread context for this worker.
auto types(void) const -> std::vector< job_type >
Retrieves the list of priority levels this worker handles.
Worker thread for typed_thread_pool processing priority job queues.
Core threading foundation of the thread system library.