![]() |
MySQL 26.7.0
Source Code Documentation
|
Interface for clock implementations scheduler uses to schedule tasks. More...
#include <scheduler_clock.h>
Public Types | |
| using | Time_point_t = uint64_t |
Public Member Functions | |
| virtual | ~Scheduler_clock ()=default |
| Destructor. More... | |
| virtual Time_point_t | now () const =0 |
| Gets current time delay, i.e. More... | |
| virtual Time_point_t | start_time () const =0 |
| Gets clock starting point, i.e. More... | |
| virtual bool | add_time (Task_id task_id, Time_point_t time)=0 |
| Subscribes a task to time processing window, delay since beginning of a schedule. More... | |
| virtual bool | tick (Task_id task_id, Time_point_t time)=0 |
| Notify that task finished execution. More... | |
| virtual bool | advances_independently () const |
| Returns property of a clock - information on whether this clock is steered by task ticks or advances independently. More... | |
| virtual bool | try_unblock () |
| Maintenance function for unblocking the clock. More... | |
| virtual Scheduler_dependency_type | get_type () const |
| Typical scheduler clock dependency type is end to start. More... | |
Interface for clock implementations scheduler uses to schedule tasks.
Tasks are subscribing for execution at specific time window by calling the 'subscribe' method. A task is ready for execution, when its execution time, i.e. parameter of the 'subscribe' method, is equal or greater than current time point, determined by the 'now' method. When task finished its execution, it must call the 'tick' method.
| using mysql::scheduler::Scheduler_clock::Time_point_t = uint64_t |
|
virtualdefault |
Destructor.
|
pure virtual |
Subscribes a task to time processing window, delay since beginning of a schedule.
| task_id | ID of the task being subscribed |
| time | Time window to which a task will be subscribed |
Implemented in mysql::scheduler::Commit_order_clock, and mysql::scheduler::Clock_lwm_registry.
|
inlinevirtual |
Returns property of a clock - information on whether this clock is steered by task ticks or advances independently.
|
inlinevirtual |
Typical scheduler clock dependency type is end to start.
Reimplemented in mysql::scheduler::Commit_order_clock.
|
pure virtual |
Gets current time delay, i.e.
current processing window value
Implemented in mysql::scheduler::Clock_lwm_registry, and mysql::scheduler::Commit_order_clock.
|
pure virtual |
Gets clock starting point, i.e.
first delay
Implemented in mysql::scheduler::Clock_lwm_registry, and mysql::scheduler::Commit_order_clock.
|
pure virtual |
Notify that task finished execution.
Called by asynchronous workers executing task. When specific conditions are met, tick will advance the internal clock value.
| task_id | ID of the task that finished execution |
| time | Delay value the task was subscribed to |
Implemented in mysql::scheduler::Commit_order_clock, and mysql::scheduler::Clock_lwm_registry.
|
inlinevirtual |
Maintenance function for unblocking the clock.