#include <timed_task.h>
A timed-task scheduler running on a single thread. This allows multiple schedulers if necessary, if e.g. you wish to schedule against InlineInvoker backing schedulable and you're running a lot of relatively quick timed tasks.Most people should just use the global timed task scheduler.
Definition at line 126 of file timed_task.h.
|
explicit |
Create a TimedTaskScheduler with specified priority
priority | The priority to set. For highest level of periodicity accuracy, use kRealtime. |
Definition at line 15 of file timed_task.cpp.
dispenso::TimedTaskScheduler::~TimedTaskScheduler | ( | ) |
Definition at line 24 of file timed_task.cpp.
|
inline |
Schedule a task to run once at a time in the future
sched | A backing schedulable, such as ImmediateInvoker, NewThreadInvoker, TaskSet, or ThreadPool to run the function in when it is scheduled. |
func | A bool() function to run when scheduled. The function may return true to indicate it should continue to be scheduled, or false to cancel. |
timeInFuture | the amount of time from current at which to schedule the function |
Definition at line 186 of file timed_task.h.
|
inline |
Schedule a task to run periodically
sched | A backing schedulable, such as ImmediateInvoker, NewThreadInvoker, TaskSet, or ThreadPool to run the function in when it is scheduled. |
func | A bool() function to run when scheduled. The function may return true to indicate it should continue to be scheduled, or false to cancel. |
timeInFuture | the amount of time from current at which to schedule the function |
period | The period defining the run frequency |
timesToRun | The number of times to run the function. After that number, the function will not be called again. |
type | The type of periodicity (if any). |
Definition at line 222 of file timed_task.h.
|
inline |
Schedule a task to run once at a time in the future
sched | A backing schedulable, such as ImmediateInvoker, NewThreadInvoker, TaskSet, or ThreadPool to run the function in when it is scheduled. |
func | A bool() function to run when scheduled. The function may return true to indicate it should continue to be scheduled, or false to cancel. |
nextRunTime | An absolute time to run the function. If in the past, func will run immediately. |
Definition at line 201 of file timed_task.h.
|
inline |
Schedule a task to run periodically
sched | A backing schedulable, such as ImmediateInvoker, NewThreadInvoker, TaskSet, or ThreadPool to run the function in when it is scheduled. |
func | A bool() function to run when scheduled. The function may return true to indicate it should continue to be scheduled, or false to cancel. |
nextRunTime | An absolute time to run the function. If in the past, func will run immediately. |
period | The period defining the run frequency |
timesToRun | The number of times to run the function. After that number, the function will not be called again. |
type | The type of periodicity (if any). |
Definition at line 254 of file timed_task.h.
|
inline |
Schedule a task
sched | A backing schedulable, such as ImmediateInvoker, NewThreadInvoker, TaskSet, or ThreadPool to run the function in when it is scheduled. |
func | A bool() function to run when scheduled. The function may return true to indicate it should continue to be scheduled, or false to cancel. |
nextRunAbs | The absolute time to run the function. Time scale is expected to match getTime() for absolute times. |
period | The period in seconds. |
timesToRun | The number of times to run the function. After that number, the function will not be called again. |
type | The type of periodicity (if any). |
Definition at line 163 of file timed_task.h.
|
inline |
Set the priority for the backing thread. See note for constructor.
Definition at line 143 of file timed_task.h.