|
typedef std::unique_ptr< _ImplBase > | __task |
|
typedef std::chrono::steady_clock::time_point | __time_point |
|
typedef _ImplBase * | task_id_t |
|
|
bool | cancel (task_id_t task_id) |
|
template<class X , class Y > |
void | delay (task_id_t task_id, std::chrono::duration< X, Y > duration) |
|
std::optional< __time_point > | next () |
|
TaskPool & | operator= (TaskPool &&other) noexcept |
|
std::optional< __task > | pop () |
|
std::optional< std::pair< __time_point, __task > > | pop (task_id_t task_id) |
|
template<class Function , class... Args> |
auto | push (Function &&newTask, Args &&...args) |
|
template<class Function , class X , class Y , class... Args> |
auto | pushDelayed (Function &&newTask, std::chrono::duration< X, Y > duration, Args &&...args) |
|
void | pushDelayed (std::pair< __time_point, __task > &&task) |
|
bool | ready () |
|
| TaskPool (TaskPool &&other) noexcept |
|
|
std::mutex | _task_mutex |
|
std::deque< __task > | _tasks |
|
std::vector< std::pair< __time_point, __task > > | _timer_tasks |
|
◆ delay()
template<class X , class Y >
void task_pool_util::TaskPool::delay |
( |
task_id_t | task_id, |
|
|
std::chrono::duration< X, Y > | duration ) |
|
inline |
- Parameters
-
task_id | The id of the task to delay. |
duration | The delay before executing the task. |
◆ pushDelayed()
template<class Function , class X , class Y , class... Args>
auto task_pool_util::TaskPool::pushDelayed |
( |
Function && | newTask, |
|
|
std::chrono::duration< X, Y > | duration, |
|
|
Args &&... | args ) |
|
inline |
- Returns
- An id to potentially delay the task.
The documentation for this class was generated from the following file: