|
FastLED 3.9.15
|
Generic time-based task scheduler.
Executes tasks at specified timestamps. Tasks are stored in a stable priority queue, ensuring FIFO ordering for tasks scheduled at the same time.
Usage: RpcScheduler<> scheduler; scheduler.schedule(1000, []() { doSomething(); }); scheduler.tick(millis()); // Execute ready tasks
Definition at line 23 of file rpc_scheduler.h.
#include <rpc_scheduler.h>
Collaboration diagram for fl::net::RpcScheduler< Task >:Classes | |
| struct | ScheduledTask |
Public Member Functions | |
| RpcScheduler () FL_NOEXCEPT=default | |
| RpcScheduler (const RpcScheduler &) FL_NOEXCEPT=delete | |
| RpcScheduler (RpcScheduler &&) FL_NOEXCEPT=default | |
| ~RpcScheduler () FL_NOEXCEPT=default | |
| void | clear () |
| Clear all scheduled tasks. | |
| RpcScheduler & | operator= (const RpcScheduler &) FL_NOEXCEPT=delete |
| RpcScheduler & | operator= (RpcScheduler &&) FL_NOEXCEPT=default |
| size_t | pendingCount () const |
| Get number of pending scheduled tasks. | |
| void | schedule (u32 timestamp, Task task) |
| Schedule a task for execution at specified timestamp. | |
| size_t | tick (u32 currentTime) |
| Execute all tasks with timestamp <= currentTime. | |
Private Attributes | |
| fl::priority_queue_stable< ScheduledTask > | mQueue |