![]() |
MySQL 26.7.0
Source Code Documentation
|
Represents task that is scheduled in the priority queue. More...
#include <scheduled_task.h>
Public Member Functions | |
| Scheduled_task (const Task_id &id, Func_type &&task, const Repeatable_task_state_ptr &repeatable_task, const Task_schedule_ptr &schedule, unsigned int phase_id) | |
| Constructor. More... | |
| bool | operator< (const Scheduled_task &arg) const |
| Returns task with a lower priority - operator needed for the priority queue. More... | |
| Scheduler_clock::Time_point_t | get_task_delay () const |
| Gets the task delay time point. More... | |
| Task_id | get_id () const |
| Gets the task ID. More... | |
| bool | is_phase_ready () const |
| Checks if the current phase is ready. More... | |
| void | set_enqueued_by_scheduler () |
| Sets the repeatable task and marks as enqueued by scheduler. More... | |
| bool | is_enqueued_by_scheduler () |
| Checks if enqueued by scheduler. More... | |
| Repeatable_task_state_ptr | get_repeatable_task () |
| Gets the shared repeatable task state that owns task lifetime. More... | |
| Dispatch_reason | get_dispatch_reason () const |
| Gets the dispatch reason for this task instance. More... | |
| void | set_dispatch_reason (Dispatch_reason dispatch_reason) |
| Sets the dispatch reason for this task instance. More... | |
Protected Attributes | |
| Task_id | m_task_id |
| Task identifier (local to scheduler) More... | |
| Func_type | m_task |
| Task function. More... | |
| Repeatable_task_state_ptr | m_repeatable_task |
| Shared repeatable task state carrying execution and logical lifetime. More... | |
| Task_schedule_ptr | m_schedule |
| Task schedule. More... | |
| int | m_phase {0} |
| Current phase counter. More... | |
| Dispatch_reason | m_dispatch_reason {Dispatch_reason::normal} |
| Dispatch reason assigned when task is released to the worker pool. More... | |
Private Types | |
| using | Func_type = std::function< Task_result(unsigned int)> |
Friends | |
| class | Scheduler |
Represents task that is scheduled in the priority queue.
|
private |
| mysql::scheduler::Scheduled_task::Scheduled_task | ( | const Task_id & | id, |
| Scheduled_task::Func_type && | task, | ||
| const Repeatable_task_state_ptr & | repeatable_task, | ||
| const Task_schedule_ptr & | schedule, | ||
| unsigned int | phase_id | ||
| ) |
Constructor.
| id | Task ID |
| task | Function to execute |
| repeatable_task | Shared repeatable task state |
| schedule | Right reference to task schedule pointer |
| phase_id | Current phase sequence number |
|
inline |
Gets the dispatch reason for this task instance.
|
inline |
Gets the task ID.
|
inline |
Gets the shared repeatable task state that owns task lifetime.
|
inline |
Gets the task delay time point.
|
inline |
Checks if enqueued by scheduler.
|
inline |
Checks if the current phase is ready.
| bool mysql::scheduler::Scheduled_task::operator< | ( | const Scheduled_task & | arg | ) | const |
Returns task with a lower priority - operator needed for the priority queue.
|
inline |
Sets the dispatch reason for this task instance.
| dispatch_reason | Reason assigned by the scheduler. |
|
inline |
Sets the repeatable task and marks as enqueued by scheduler.
|
friend |
|
protected |
Dispatch reason assigned when task is released to the worker pool.
|
protected |
Current phase counter.
|
protected |
Shared repeatable task state carrying execution and logical lifetime.
|
protected |
Task schedule.
|
protected |
Task function.
|
protected |
Task identifier (local to scheduler)