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.
Returns the shared instance of the async task pool.
instance of the async task pool.
Returns the shared instance of the async task pool.
instance of the async task pool.
static void destoryInstance |
( |
| ) |
|
|
inlinestatic |
local destoryInstance |
( |
| ) |
|
|
inlinestatic |
void stopTasks |
( |
TaskType |
type | ) |
|
|
inline |
Stop tasks.
Task type you want to stop.
local stopTasks |
( |
local |
type | ) |
|
|
inline |
Stop tasks.
Task type you want to stop.
void enqueue |
( |
AsyncTaskPool::TaskType |
type, |
|
|
const TaskCallBack & |
callback, |
|
|
void * |
callbackParam, |
|
|
F && |
f |
|
) |
| |
|
inline |
Enqueue a asynchronous task.
task type is io task, network task or others, each type of task has a thread to deal with it. callback when the task is finished. The callback is called in the main thread instead of task thread. parameter used by the callback. task can be lambda function.
The documentation for this class was generated from the following file: