Nugget
|
#include <psyqo/task.hh>
Public Member Functions | |
Task (eastl::function< void(Task *)> &&fun) | |
Construct a new Task object. | |
Task (Task &&)=default | |
Task (const Task &)=delete | |
Task & | operator= (Task &&)=default |
Task & | operator= (const Task &)=delete |
void | resolve () |
Resolves this task. | |
void | reject () |
Rejects this task. | |
void | complete (bool success) |
Resolves or rejects this task. | |
Friends | |
class | TaskQueue |
The Task class.
This class is the holder for a task to execute within the queue. It can be constructed with a lambda, or be moved. It effectively acts as a promise, but without data attached to it.
Construct a new Task object.
fun | The lambda to execute for this task. It will receive the task as its argument. |
|
default |
|
delete |
|
inline |
|
inline |
Rejects this task.
This method is to be called by the task's lambda function to reject the task. It will call the exception handler, and then the finally handler.
|
inline |
Resolves this task.
This method is to be called by the task's lambda function to resolve the task. It will continue to the next task in the queue, or call the finally handler if there are no more tasks.
|
friend |