|
lintel 0.2.0
|
#include <SchedulerService.h>
Public Member Functions | |
| template<class F , class... Args> | |
| auto | schedule (F &&f, Args &&...args) -> std::future< std::invoke_result_t< std::decay_t< F >, std::decay_t< Args >... > > |
| template<class F , class... Args> | |
| auto | schedule_after (const std::chrono::steady_clock::duration &d, F &&f, Args &&...args) -> std::future< std::invoke_result_t< std::decay_t< F >, std::decay_t< Args >... > > |
| template<class F , class... Args> | |
| auto | schedule_at (const std::chrono::steady_clock::time_point &t, F &&f, Args &&...args) -> std::future< std::invoke_result_t< std::decay_t< F >, std::decay_t< Args >... > > |
| template<class F , class... Args> | |
| void | schedule_at_fixed_rate (const std::chrono::steady_clock::duration &d, const std::chrono::steady_clock::duration &period, F &&f, Args &&...args) |
| void | clear () |
| SchedulerService (const std::shared_ptr< ProcessName > &processName) | |
| void | onInitialize () override |
| void | onShutdown () override |
| virtual | ~SchedulerService () |
Public Member Functions inherited from lintel::AbstractService< T > | |
| AbstractService ()=delete | |
| AbstractService (std::string processName, std::string instanceName) | |
| AbstractService (std::string processName) | |
| ShutdownPriority | shutdownPriorityOf () const override |
| const std::string & | getProcessName () const override |
| const std::string & | getInstanceName () const override |
| std::string_view | getClassName () const override |
Public Member Functions inherited from lintel::AbstractServiceInterface | |
| virtual | ~AbstractServiceInterface ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from lintel::PropertyRegistration< SchedulerService > | |
| std::shared_ptr< Property< type > > | registerProperty (std::string name, type defaultValue, std::string description, bool runtime, const std::string &fileName, int32_t position) |
Protected Attributes inherited from lintel::AbstractService< T > | |
| std::vector< std::shared_ptr< PropertyBase > > | m_properties |
Service for scheduling and executing tasks at specified times or at fixed rates.
|
explicit |
Constructor.
| processName | current process name |
|
virtual |
| void lintel::SchedulerService::clear | ( | ) |
Remove all scheduled tasks.
|
overridevirtual |
Default initialization does nothing; override in subclasses.
Reimplemented from lintel::AbstractService< T >.
|
overridevirtual |
Default shutdown does nothing; override in subclasses.
Reimplemented from lintel::AbstractService< T >.
| auto lintel::SchedulerService::schedule | ( | F && | f, |
| Args &&... | args | ||
| ) | -> std::future<std::invoke_result_t<std::decay_t<F>, std::decay_t<Args>...>> |
Schedule a task for immediate execution.
| F | callable type |
| Args | argument types |
| f | callable to execute |
| args | arguments to pass |
| auto lintel::SchedulerService::schedule_after | ( | const std::chrono::steady_clock::duration & | d, |
| F && | f, | ||
| Args &&... | args | ||
| ) | -> std::future<std::invoke_result_t<std::decay_t<F>, std::decay_t<Args>...>> |
Schedule a task for execution after a delay.
| F | callable type |
| Args | argument types |
| d | delay duration |
| f | callable to execute |
| args | arguments to pass |
| auto lintel::SchedulerService::schedule_at | ( | const std::chrono::steady_clock::time_point & | t, |
| F && | f, | ||
| Args &&... | args | ||
| ) | -> std::future<std::invoke_result_t<std::decay_t<F>, std::decay_t<Args>...>> |
Schedule a task for execution at a specific time point.
| F | callable type |
| Args | argument types |
| t | absolute time point for execution |
| f | callable to execute |
| args | arguments to pass |
| void lintel::SchedulerService::schedule_at_fixed_rate | ( | const std::chrono::steady_clock::duration & | d, |
| const std::chrono::steady_clock::duration & | period, | ||
| F && | f, | ||
| Args &&... | args | ||
| ) |
Schedule a task for repeated execution at a fixed rate.
| F | callable type |
| Args | argument types |
| d | initial delay |
| period | interval between executions |
| f | callable to execute |
| args | arguments to pass |