|
ecor
|
Maintains a list of ready tasks that can be resumed. More...
#include <ecor.hpp>
Public Member Functions | |
| void | reschedule (_schedulable &op) noexcept |
| Reschedule a task by adding it's promise to the list of ready tasks. More... | |
| void | run_n (std::size_t n) |
| Run up to n ready tasks. More... | |
| bool | run_once () |
| Run a single ready task if there is one. More... | |
Maintains a list of ready tasks that can be resumed.
Used by the library to re-schedule woken-up tasks. Has to be periodically polled by the user to run the ready tasks, either by calling run_once() to run a single task, or run_n() to run multiple tasks.
|
inlinenoexcept |
Reschedule a task by adding it's promise to the list of ready tasks.
The task will be resumed the next time run_once() or run_n() is called.
|
inline |
Run up to n ready tasks.
This repeatedly calls run_once() until either n tasks have been run or there are no more ready tasks to run.
|
inline |
Run a single ready task if there is one.
This removes the task from the list of ready tasks and resumes it. Returns true if a task was run, or false if there were no ready tasks to run.