pub struct RunContext<'a, F, S, O>{
pub fs: &'a F,
pub cache: &'a Cache<F>,
pub spawner: &'a S,
pub observer: &'a O,
pub workspace: &'a Workspace,
pub graph: &'a TaskGraph,
pub host_env: &'a BTreeMap<EnvVarName, String>,
pub algo: HashAlgo,
pub cancel: &'a CancellationToken,
}Expand description
Borrowed bundle of long-lived state that every run_task
invocation in a given haz run shares.
The split between this context and the per-task arguments
matches a scheduler’s natural shape: one RunContext covers
the entire scheduling loop, while task, predecessor_streams,
and created_at_unix change between individual run_task
calls.
Fields§
§fs: &'a FFilesystem the executor reads inputs / outputs / cache state through.
cache: &'a Cache<F>Cache handle (lookup, restore, store).
spawner: &'a SProcess spawner (a test-double mock under cfg(test),
crate::std_impl::StdProcessSpawner in production).
observer: &'a OObserver that receives lifecycle events and captured streams.
workspace: &'a WorkspaceValidated workspace state.
graph: &'a TaskGraphValidated dependency graph.
host_env: &'a BTreeMap<EnvVarName, String>Host-environment snapshot. Names not present here are
treated as absent per CACHE-008.
algo: HashAlgoActive hash algorithm for cache-key derivation, input / output content hashing, and captured-stream hashing.
cancel: &'a CancellationTokenCancellation signal for the run (EXEC-012 triggers).
The scheduler and per-task spawn-step futures observe
this token: when it fires, the scheduler stops admitting
new tasks and in-flight futures send SIGTERM to their
children. The token is long-lived ambient state owned by
the run’s caller (typically haz-cli installing an OS
signal handler); tests pass a never-cancelled token.