Class TaskHolder<Ret>

#include <Geode/utils/async.hpp>
template<typename Ret = void>classTaskHolder{ ... }

Allows an async task to be spawned and then automatically aborted when the holder goes out of scope.

Examples0
Public static methods0
Public member functions7
template<typename F,typename Cb>voidspawn(
F&&future
,)

Spawns the given future, invoking the callback in the main thread on completion. Lambdas that return a future are also accepted.

template<typename F,typename Cb>voidspawn(,
F&&future
,)

Spawns the given future, assigning a name to the task and invoking the callback in the main thread on completion. Lambdas that return a future are also accepted.

geode::async::TaskHolder&operator=()
No description provided
geode::async::TaskHolder&operator=()
No description provided
voidcancel()

Terminates the task as soon as possible and ensures the callback will not be called. This is optional and called automatically when destroying or spawning another task. Does nothing if there is no pending task.

voidsetName()

Sets the name for the currently spawned task, for debugging purposes

boolisPending()const

Checks if the spawned task is still pending. This will return false if no task is spawned, or if called inside the completion callback.

Fields0
Protected member functions0
Protected fields0
Derived classes0