Skip to main content

spawn_task

Function spawn_task 

Source
pub fn spawn_task<T: TaskWorkerTrait>(
    commands: Commands<'_, '_>,
    q_context: Query<'_, '_, (Entity, &TaskWorker<T>, &Timestep, &SubstepCount, &T::TaskExtractedData)>,
    virtual_time: Res<'_, Time<Virtual>>,
)
Expand description

This system spawns a WorkTask is none are ongoing. The task simulate computationally intensive work that potentially spans multiple frames/ticks.

A separate system, finish_task_and_store_result, will poll the spawned tasks on subsequent frames/ticks within RunFixedMainLoop, and consider if FixedMain should be run.