Skip to main content

spawn_computed

Function spawn_computed 

Source
pub fn spawn_computed<F>(
    workdir: PathBuf,
    label: String,
    shown: String,
    f: F,
) -> Effect
where F: FnOnce(&Path) -> Result<(), String> + Send + 'static,
Expand description

MG.43d: run a multi-step operation whose LATER steps depend on state only discoverable part-way through.

spawn_git_sequence takes its steps up front, which cannot express “create the branch only if it is missing” or “compare-and-swap the ref only if the commit was at the tip”. Computing those on the actor thread would be git I/O on a keystroke, so the whole operation runs inside one spawn_blocking and reports once, exactly like a sequence does.