1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Generic DAG task executor.
//!
//! Provides a parallel task execution engine with dependency resolution,
//! pluggable caching, dynamic worker pools, and configurable error handling.
//!
//! # DAG Construction
//!
//! Multiple interfaces are available for building a DAG:
//!
//! - [`DagBuilder`] — programmatic API with explicit tasks and dependencies
//! - [`StageBuilder`] — template pattern: "apply N stages to M resources"
//! - [`DagTask`] trait — implement for fully custom task behavior
//!
//! # Example: Stage Builder (deployment pattern)
//!
//! ```rust,no_run
//! use consortium::dag::*;
//!
//! let report = StageBuilder::new()
//! .resources(vec!["host1".into(), "host2".into()])
//! .stage("build", Some(4), |host| {
//! Box::new(ShellTask {
//! command: format!("echo building {}", host),
//! description: format!("build {}", host),
//! resource: None,
//! })
//! })
//! .stage("deploy", Some(2), |host| {
//! Box::new(ShellTask {
//! command: format!("echo deploying {}", host),
//! description: format!("deploy {}", host),
//! resource: None,
//! })
//! })
//! .error_policy(ErrorPolicy::ContinueIndependent)
//! .build()
//! .unwrap()
//! .run()
//! .unwrap();
//!
//! assert!(report.is_success());
//! ```
// Re-export key types at module level
pub use ;
pub use ;
pub use DagContext;
pub use ;
pub use ;
pub use DagGraph;
pub use ;
pub use ;