Expand description
Phase-based scheduling and centralized runtime display.
Applications declare the complete config -> tasks -> phases -> runtime
structure before execution. WorkflowRuntime schedules only those tasks,
displays their lifecycle, and provides cooperative cancellation. Each task
workload owns all scientific I/O, artifacts, recordings, and subprocesses.
use scientific_workflow::prelude::basics::*;
use scientific_workflow::prelude::runtime::*;
let project = ScientificProject::load("my-project")
.map_err(|error| RuntimeError::TaskWorkload {
task: "load-project".to_owned(),
source: Box::new(error),
})?;
let phase = Phase::builder(2, "simulation")
.activity_tasks_from_project(&project, "prepare", |context| {
context.set_detail("ready");
Ok(())
})
.max_concurrent_workloads(1)
.queue_capacity(1)
.build()?;
let summary = WorkflowRuntime::builder()
.phase(phase)
.hidden()
.build()?
.run_phases([2])?;
assert!(summary.is_success());Structs§
- Activity
Task - Non-clone task-local handle for lifecycle-only work.
- Cancellation
Token - Shared, cheap cancellation observation for embedded schedulers and tasks.
- Phase
- Immutable nonempty execution phase and reporter section.
- Phase
Builder - Builder for one nonempty first-class phase.
- PhaseId
- Stable numeric identity of one execution phase.
- Phase
Summary - Terminal summary for one selected phase.
- Progress
Summary - Immutable aggregate captured when centralized reporting ends.
- Runtime
Summary - Immutable aggregate for a completed selected runtime plan.
- Task
- First-class immutable task declaration owned by exactly one
Phase. - Task
Context - Read-only task identity/configuration plus reporting and cancellation.
- TaskId
- Stable task identity scoped to one phase.
- Task
Identity - Exact parameter-derived identity of one task.
- TaskKey
- Exact runtime task lookup key.
- Task
Progress - Non-clone task-local progress handle.
- Task
Selector - Exact partial selector over phase, task kind, and structured parameters.
- Workflow
Runtime - Non-clone scheduler and display owner for one declared workflow plan.
- Workflow
Runtime Builder - Builder for one immutable runtime plan.
Enums§
- Phase
Failure Policy - Scheduling behavior after the first workload failure in a phase.
- Runtime
Error - Failure while planning, executing, or displaying a workflow runtime.
- Task
Display Kind - Reporting shape of one task.
- Task
Status - Lifecycle status of one independently executing scientific task.
Type Aliases§
- Task
Result - Error-erased result returned by one task-owned workload.