This class allows to perform background operations without having to manipulate threads.
More...
|
| void | stopTasks (TaskType type) |
| | Stop tasks. More...
|
| |
| template<class F > |
| void | enqueue (TaskType type, const TaskCallBack &callback, void *callbackParam, F &&f) |
| | Enqueue a asynchronous task. More...
|
| |
This class allows to perform background operations without having to manipulate threads.
| void stopTasks |
( |
TaskType |
type | ) |
|
|
inline |
Stop tasks.
- Parameters
-
| type | Task type you want to stop. |
| local stopTasks |
( |
local |
type | ) |
|
|
inline |
Stop tasks.
- Parameters
-
| type | Task type you want to stop. |
| void enqueue |
( |
AsyncTaskPool::TaskType |
type, |
|
|
const TaskCallBack & |
callback, |
|
|
void * |
callbackParam, |
|
|
F && |
f |
|
) |
| |
|
inline |
Enqueue a asynchronous task.
- Parameters
-
| type | task type is io task, network task or others, each type of task has a thread to deal with it. |
| callback | callback when the task is finished. The callback is called in the main thread instead of task thread. |
| callbackParam | parameter used by the callback. |
| f | task can be lambda function. |
The documentation for this class was generated from the following file: