Skip to main content

scientific_workflow/
task.rs

1//! Generic application workloads behind one uniform runtime definition.
2//!
3//! Application authors implement the crate-root [`ExecutionUnit`] contract and
4//! register the implementation with
5//! `#[scientific_workflow::execution_unit("key")]`.
6//! Study creates execution-unit tasks from registrations plus resolved constants and
7//! creates program tasks directly from declarative executable paths. Python
8//! declarations are lowered by Config to the same program boundary. All use
9//! one private Task definition; adapters and execution ports remain crate-private.
10
11mod catalog;
12mod definition;
13pub mod dependencies;
14mod execution;
15pub mod project;
16mod unit;
17
18#[cfg(test)]
19#[path = "task/tests/task_workflow.rs"]
20mod task_workflow_tests;
21
22#[doc(hidden)]
23pub use catalog::ExecutionUnitRegistration;
24pub(crate) use catalog::{ExecutionUnitCatalog, ExecutionUnitCatalogError};
25pub(crate) use definition::{ExecutionUnitTaskProvenance, Task, TaskKind};
26pub(crate) use execution::{
27    MemberInitialization, ProgramTaskInvocation, TaskDefinition, TaskExecutionHost,
28};
29/// Result returned by execution-unit construction and steps.
30pub type UnitResult<T = ()> = Result<T, Box<dyn std::error::Error + Send + Sync + 'static>>;
31pub(crate) type TaskResult<T = ()> = UnitResult<T>;
32pub use unit::{ExecutionUnit, InitializationContext, MemberCompletion, MemberView, SeedError};
33pub(crate) use unit::{SEED_DERIVATION_ALGORITHM, derive_program_seed};