Skip to main content

process_command

Function process_command 

Source
pub fn process_command(
    runner: &mut SceneRunner,
    command: Command,
    progress: &mut dyn FnMut(RunProgress) -> bool,
) -> Option<Reply>
Expand description

Execute ONE Command against runner and return the Reply it produces, if any. The shared step both async drivers run: the native [thread_main] calls it for each (post-coalescing) command on the runner thread; the wasm WorkerRunner’s worker_entry calls it per postMessage on the worker. Run → a Reply::Run; Query → a Reply::Query; Reset drops the delta baseline AND the runner’s OWN kernel history cache (the resident registry lives with the runner — thread or worker — not on main) and yields no reply.

progress is called before every feature a Run actually executes, with the report the driver should ship as Reply::Progress; returning false stops the run at that boundary (the native thread’s cooperative cancel — the worker is terminated instead and always returns true).