Skip to main content

Module runtime

Module runtime 

Source
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§

ActivityTask
Non-clone task-local handle for lifecycle-only work.
CancellationToken
Shared, cheap cancellation observation for embedded schedulers and tasks.
Phase
Immutable nonempty execution phase and reporter section.
PhaseBuilder
Builder for one nonempty first-class phase.
PhaseId
Stable numeric identity of one execution phase.
PhaseSummary
Terminal summary for one selected phase.
ProgressSummary
Immutable aggregate captured when centralized reporting ends.
RuntimeSummary
Immutable aggregate for a completed selected runtime plan.
Task
First-class immutable task declaration owned by exactly one Phase.
TaskContext
Read-only task identity/configuration plus reporting and cancellation.
TaskId
Stable task identity scoped to one phase.
TaskIdentity
Exact parameter-derived identity of one task.
TaskKey
Exact runtime task lookup key.
TaskProgress
Non-clone task-local progress handle.
TaskSelector
Exact partial selector over phase, task kind, and structured parameters.
WorkflowRuntime
Non-clone scheduler and display owner for one declared workflow plan.
WorkflowRuntimeBuilder
Builder for one immutable runtime plan.

Enums§

PhaseFailurePolicy
Scheduling behavior after the first workload failure in a phase.
RuntimeError
Failure while planning, executing, or displaying a workflow runtime.
TaskDisplayKind
Reporting shape of one task.
TaskStatus
Lifecycle status of one independently executing scientific task.

Type Aliases§

TaskResult
Error-erased result returned by one task-owned workload.