Ring Daemon 16.0.0
|
#include <scheduled_executor.h>
Public Types | |
using | clock = std::chrono::steady_clock |
using | duration = clock::duration |
using | time_point = clock::time_point |
Public Member Functions | |
void | run (std::function< void()> &&job, const char *filename=CURRENT_FILENAME(), uint32_t linum=CURRENT_LINE()) |
Schedule job to be run ASAP. | |
std::shared_ptr< Task > | schedule (std::function< void()> &&job, time_point t, const char *filename=CURRENT_FILENAME(), uint32_t linum=CURRENT_LINE()) |
Schedule job to be run at time t. | |
std::shared_ptr< RepeatedTask > | scheduleAtFixedRate (std::function< bool()> &&job, duration dt, const char *filename=CURRENT_FILENAME(), uint32_t linum=CURRENT_LINE()) |
Schedule job to be run every dt, starting now. | |
ScheduledExecutor (const std::string &name_) | |
std::shared_ptr< Task > | scheduleIn (std::function< void()> &&job, duration dt, const char *filename=CURRENT_FILENAME(), uint32_t linum=CURRENT_LINE()) |
Schedule job to be run after delay dt. | |
void | stop () |
Stop the scheduler, it is unable to be reversed. | |
~ScheduledExecutor () | |
Definition at line 178 of file scheduled_executor.h.
using jami::ScheduledExecutor::clock = std::chrono::steady_clock |
Definition at line 181 of file scheduled_executor.h.
using jami::ScheduledExecutor::duration = clock::duration |
Definition at line 183 of file scheduled_executor.h.
using jami::ScheduledExecutor::time_point = clock::time_point |
Definition at line 182 of file scheduled_executor.h.
jami::ScheduledExecutor::ScheduledExecutor | ( | const std::string & | name_ | ) |
Definition at line 24 of file scheduled_executor.cpp.
References jami::emitSignal().
jami::ScheduledExecutor::~ScheduledExecutor | ( | ) |
Definition at line 36 of file scheduled_executor.cpp.
References jami::emitSignal(), and stop().
void jami::ScheduledExecutor::run | ( | std::function< void()> && | job, |
const char * | filename = CURRENT_FILENAME() , |
||
uint32_t | linum = CURRENT_LINE() |
||
) |
Schedule job to be run ASAP.
Definition at line 62 of file scheduled_executor.cpp.
References jami::emitSignal().
Referenced by jami::runOnMainThread().
std::shared_ptr< Task > jami::ScheduledExecutor::schedule | ( | std::function< void()> && | job, |
time_point | t, | ||
const char * | filename = CURRENT_FILENAME() , |
||
uint32_t | linum = CURRENT_LINE() |
||
) |
Schedule job to be run at time t.
Definition at line 72 of file scheduled_executor.cpp.
References jami::emitSignal(), and schedule().
Referenced by schedule(), scheduleIn(), and jami::Manager::scheduleTask().
std::shared_ptr< RepeatedTask > jami::ScheduledExecutor::scheduleAtFixedRate | ( | std::function< bool()> && | job, |
duration | dt, | ||
const char * | filename = CURRENT_FILENAME() , |
||
uint32_t | linum = CURRENT_LINE() |
||
) |
Schedule job to be run every dt, starting now.
Definition at line 89 of file scheduled_executor.cpp.
References jami::emitSignal().
std::shared_ptr< Task > jami::ScheduledExecutor::scheduleIn | ( | std::function< void()> && | job, |
duration | dt, | ||
const char * | filename = CURRENT_FILENAME() , |
||
uint32_t | linum = CURRENT_LINE() |
||
) |
Schedule job to be run after delay dt.
Definition at line 81 of file scheduled_executor.cpp.
References jami::emitSignal(), and schedule().
Referenced by jami::Call::Call().
void jami::ScheduledExecutor::stop | ( | ) |
Stop the scheduler, it is unable to be reversed.
Definition at line 53 of file scheduled_executor.cpp.
Referenced by ~ScheduledExecutor().