MySQL 26.7.0
Source Code Documentation
mysql::scheduler::Scheduler_clock Class Referenceabstract

Interface for clock implementations scheduler uses to schedule tasks. More...

#include <scheduler_clock.h>

Inheritance diagram for mysql::scheduler::Scheduler_clock:
[legend]

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...
 

Detailed Description

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.

Member Typedef Documentation

◆ Time_point_t

Constructor & Destructor Documentation

◆ ~Scheduler_clock()

virtual mysql::scheduler::Scheduler_clock::~Scheduler_clock ( )
virtualdefault

Destructor.

Member Function Documentation

◆ add_time()

virtual bool mysql::scheduler::Scheduler_clock::add_time ( Task_id  task_id,
Time_point_t  time 
)
pure virtual

Subscribes a task to time processing window, delay since beginning of a schedule.

Parameters
task_idID of the task being subscribed
timeTime window to which a task will be subscribed
Returns
True if task has been subscribed, false otherwise

Implemented in mysql::scheduler::Commit_order_clock, and mysql::scheduler::Clock_lwm_registry.

◆ advances_independently()

virtual bool mysql::scheduler::Scheduler_clock::advances_independently ( ) const
inlinevirtual

Returns property of a clock - information on whether this clock is steered by task ticks or advances independently.

◆ get_type()

virtual Scheduler_dependency_type mysql::scheduler::Scheduler_clock::get_type ( ) const
inlinevirtual

Typical scheduler clock dependency type is end to start.

Reimplemented in mysql::scheduler::Commit_order_clock.

◆ now()

virtual Time_point_t mysql::scheduler::Scheduler_clock::now ( ) const
pure virtual

Gets current time delay, i.e.

current processing window value

Returns
Current time, i.e. current processing window value

Implemented in mysql::scheduler::Clock_lwm_registry, and mysql::scheduler::Commit_order_clock.

◆ start_time()

virtual Time_point_t mysql::scheduler::Scheduler_clock::start_time ( ) const
pure virtual

Gets clock starting point, i.e.

first delay

Returns
clock start point

Implemented in mysql::scheduler::Clock_lwm_registry, and mysql::scheduler::Commit_order_clock.

◆ tick()

virtual bool mysql::scheduler::Scheduler_clock::tick ( Task_id  task_id,
Time_point_t  time 
)
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.

Parameters
task_idID of the task that finished execution
timeDelay value the task was subscribed to
Returns
True if clock advanced its time

Implemented in mysql::scheduler::Commit_order_clock, and mysql::scheduler::Clock_lwm_registry.

◆ try_unblock()

virtual bool mysql::scheduler::Scheduler_clock::try_unblock ( )
inlinevirtual

Maintenance function for unblocking the clock.


The documentation for this class was generated from the following file: