Main scheduler for managing and executing periodic tasks.
More...
Main scheduler for managing and executing periodic tasks.
TaskScheduler manages a collection of tasks, executes them according to their timing requirements, and tracks performance metrics.
◆ TaskInfoCallback
Callback signature for task status reporting.
- Parameters
-
| name | Task name |
| isAttached | Whether the task is currently attached |
| elapsed | Total execution time in milliseconds |
◆ TaskPtr
Shared pointer type for scheduler tasks.
◆ exportTasksInfo()
Report information about all registered tasks.
- Parameters
-
| callback | Function that receives information about each task |
◆ getTotalElapsedMs()
| uint64_t uniot::TaskScheduler::getTotalElapsedMs |
( |
| ) |
const |
|
inline |
Get the total execution time of the scheduler in milliseconds.
- Return values
-
| time | Total elapsed time in milliseconds |
◆ loop()
| void uniot::TaskScheduler::loop |
( |
| ) |
|
|
inline |
Main execution loop for the scheduler.
Executes all registered tasks and tracks timing metrics
◆ make() [1/2]
Static factory method to create a task from an IExecutor.
- Parameters
-
| executor | The executor to wrap in a task |
- Return values
-
◆ make() [2/2]
Static factory method to create a task with a callback.
- Parameters
-
| callback | Function to execute when the task runs |
- Return values
-
◆ push() [1/2]
Add a named task to the scheduler.
- Parameters
-
| name | Identifier for the task |
| task | Shared pointer to the task |
- Return values
-
| TaskScheduler& | Reference to the current scheduler instance |
◆ push() [2/2]
Add connection kit components to the scheduler.
- Parameters
-
| connection | The connection kit to integrate |
- Return values
-
| TaskScheduler& | Reference to the current scheduler instance |
◆ TaskScheduler()
| uniot::TaskScheduler::TaskScheduler |
( |
| ) |
|
|
inline |