ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
scheduler_loop Class Referencefinal

In-process scheduler loop that fires jobs based on cron expressions. More...

#include <scheduler_loop.hpp>

Collaboration diagram for scheduler_loop:
Collaboration graph

Public Member Functions

 scheduler_loop (database::context system_ctx, std::vector< std::unique_ptr< action_handler > > handlers)
 
boost::asio::awaitable< void > run (boost::asio::io_context &ioc)
 Run the scheduler loop.
 
void reload ()
 Signal the loop to reload job definitions on the next tick.
 

Detailed Description

In-process scheduler loop that fires jobs based on cron expressions.

Loads all active job definitions at startup, then wakes at each minute boundary to evaluate which jobs are due. Each firing creates a job_instance record and delegates execution to the appropriate action_handler.

Call reload() to signal the loop that the job table has changed; it will reload definitions on the next tick.

Member Function Documentation

◆ run()

boost::asio::awaitable< void > run ( boost::asio::io_context &  ioc)

Run the scheduler loop.

This coroutine runs indefinitely, waking at each minute boundary and firing any due jobs. Returns only when the io_context is stopped.