Function godot_task
pub fn godot_task(future: impl Future<Output = ()> + 'static) -> TaskHandle
Expand description
Create a new async background task.
This function allows creating a new async task in which Godot signals can be awaited, like it is possible in GDScript. The
TaskHandle
that is returned provides synchronous introspection into the current state of the task.
Refer to Signal::to_future
and Signal::to_fallible_future
for details on how to await a signal.
ยงPanics
- If called from any other thread than the main-thread.