Honeycomb
0.1
Component-Model Framework
|
Scheduler that executes tasks periodically or after a delay given a pool of threads. More...
#include <PeriodicTask.h>
Public Member Functions | |
PeriodicSched (thread::Pool &pool) | |
~PeriodicSched () | |
template<class Func , class PeriodicTask_ = PeriodicTask_<typename std::result_of<Func()>::type>> | |
PeriodicTask_::Ptr | schedule (Func &&f, optional< MonoClock::Duration > period=optnull, optional< MonoClock::Duration > delay=optnull, const Id &id=idnull) |
Schedule a task for execution. More... | |
Static Public Member Functions | |
static | mt_global (PeriodicSched, inst,(future::AsyncSched::inst())) |
Get singleton, uses global future::AsyncSched pool. More... | |
Static Public Attributes | |
static bool | trace = false |
Whether to log task execution flow. More... | |
Friends | |
class | PeriodicTask |
Scheduler that executes tasks periodically or after a delay given a pool of threads.
honey::PeriodicSched::PeriodicSched | ( | thread::Pool & | pool | ) |
pool | Shared ref to thread pool with which all tasks will be enqueued. |
honey::PeriodicSched::~PeriodicSched | ( | ) |
|
static |
Get singleton, uses global future::AsyncSched pool.
|
inline |
Schedule a task for execution.
f | the function to execute |
period | Execute function every period amount of time. If not specified then the function will execute only once. If execution takes longer than the period, then any subsequent execution will start immediately (not concurrently). |
delay | Delay first execution for an amount of time. If not specified then the function will be delayed for the amount of time specified by period . |
id | display id for debugging |
|
friend |
|
static |
Whether to log task execution flow.