Depend on futures-util instead of futures

This commit is contained in:
TechnoPorg committed 2026-02-11 22:44:01 +01:00
1 parent f342e33f16
commit a75defa5a6
79 files changed
+447 -380

No files matched your search

+3 -3
View File
@@ -38,7 +38,7 @@ See [how it works](docs/CYCLE_PREVENTION.md).
```rust
let sum = dag.add_task(Add).depends_on((&x, &y));
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() }).await?;
```
That's it. No trait boilerplate, no manual channels, no node IDs.
@@ -91,7 +91,7 @@ async fn main() {
let sum = dag.add_task(Add).depends_on((x, &y));
// Execute with true parallelism
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await.unwrap();
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() }).await.unwrap();
// Retrieve results
assert_eq!(dag.get(sum).unwrap(), 5);
@@ -223,7 +223,7 @@ dagx works with any async runtime. Provide a spawner function to `run()`:
```rust
// With Tokio
// The join handle result can be unwrapped because dagx catches panics internally
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await.unwrap();
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() }).await.unwrap();
// With async-std
dag.run(|fut| async_std::task::spawn(fut)).await.unwrap();