mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
add Task::cancelled
This commit is contained in:
parent
971e3fb254
commit
1a82d12b7b
1 changed files with 9 additions and 0 deletions
|
@ -390,6 +390,15 @@ namespace geode {
|
|||
return m_handle == nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Task that is immediately cancelled
|
||||
* @param name The name of the Task; used for debugging
|
||||
*/
|
||||
static Task cancelled(std::string_view const name = "<Cancelled Task>") {
|
||||
auto task = Task(Handle::create(name));
|
||||
Task::cancel(task.m_handle);
|
||||
return task;
|
||||
}
|
||||
/**
|
||||
* Create a new Task that immediately finishes with the given
|
||||
* value
|
||||
|
|
Loading…
Reference in a new issue