chore: clean up in preparation for release

This commit is contained in:
TechnoPorg committed 2026-02-18 22:34:31 +01:00
1 parent c002161216
commit 827041c1b6
28 files changed
+112 -219

No files matched your search

+1 -1
View File
@@ -93,7 +93,7 @@ async fn main() {
.add_task(Add {
label: "Sum".to_string(),
})
.depends_on((&x, &y)); // Pass handles as a tuple
.depends_on((x, y)); // Pass handles as a tuple
// sum is now TaskHandle<i32>
// Step 6: Execute the DAG
+1 -1
View File
@@ -29,7 +29,7 @@
//! ## Key Concepts
//! - **Fan-in**: Multiple tasks' outputs are consumed by a single downstream task
//! - **Aggregation**: Combining multiple values into a single result
//! - **Parameter order**: The order in `.depends_on((&a, &b, &c))` must match
//! - **Parameter order**: The order in `.depends_on((a, b, c))` must match
//! the function signature `fn run(a: &T1, b: &T2, c: &T3)`
//!
//! ## Use Cases
+9 -9
View File
@@ -52,7 +52,7 @@
//! This proves dagx runs tasks on multiple CPU cores simultaneously.
//! ```
use dagx::{task, DagResult, DagRunner, Task, TaskInput};
use dagx::{task, DagResult, DagRunner};
use std::time::{Duration, Instant};
use tokio::time::sleep;
@@ -149,15 +149,15 @@ async fn main() -> DagResult<()> {
let start = Instant::now();
// Run tasks sequentially (not using DAG, just raw execution)
let task1 = ComputeSum::new(1, 251, WORK_DELAY);
let task2 = ComputeSum::new(251, 501, WORK_DELAY);
let task3 = ComputeSum::new(501, 751, WORK_DELAY);
let task4 = ComputeSum::new(751, 1001, WORK_DELAY);
let mut task1 = ComputeSum::new(1, 251, WORK_DELAY);
let mut task2 = ComputeSum::new(251, 501, WORK_DELAY);
let mut task3 = ComputeSum::new(501, 751, WORK_DELAY);
let mut task4 = ComputeSum::new(751, 1001, WORK_DELAY);
let r1 = task1.run(TaskInput::empty()).await;
let r2 = task2.run(TaskInput::empty()).await;
let r3 = task3.run(TaskInput::empty()).await;
let r4 = task4.run(TaskInput::empty()).await;
let r1 = task1.run_impl().await;
let r2 = task2.run_impl().await;
let r3 = task3.run_impl().await;
let r4 = task4.run_impl().await;
let result = r1 + r2 + r3 + r4;
let elapsed = start.elapsed();
+4 -6
View File
@@ -203,20 +203,18 @@ async fn main() {
// Stage 3: Statistical analysis (parallel operations on transformed data)
let sum = dag
.add_task(ComputeSum)
.depends_on((&transformed_1, &transformed_2, &transformed_3));
.depends_on((transformed_1, transformed_2, transformed_3));
let product =
dag.add_task(ComputeProduct)
.depends_on((&transformed_1, &transformed_2, &transformed_3));
.depends_on((transformed_1, transformed_2, transformed_3));
let max = dag
.add_task(FindMax)
.depends_on((&transformed_1, &transformed_2, &transformed_3));
.depends_on((transformed_1, transformed_2, transformed_3));
// Stage 4: Final report
let report = dag
.add_task(GenerateReport)
.depends_on((&sum, &product, &max));
let report = dag.add_task(GenerateReport).depends_on((sum, product, max));
// Execute the pipeline
println!("Executing pipeline...\n");