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

+2 -2
View File
@@ -4,7 +4,7 @@
use criterion::Criterion;
use dagx::TaskHandle;
use futures::FutureExt;
pub fn bench_deep_chain(c: &mut Criterion) {
let rt = tokio::runtime::Runtime::new().unwrap();
@@ -29,7 +29,7 @@ pub fn bench_deep_chain(c: &mut Criterion) {
.depends_on(prev);
}
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap))
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() })
.await
.unwrap();
dag.get(prev).unwrap()
+2 -2
View File
@@ -4,7 +4,7 @@
use criterion::Criterion;
use dagx::TaskHandle;
use futures::FutureExt;
pub fn bench_diamond_pattern(c: &mut Criterion) {
let rt = tokio::runtime::Runtime::new().unwrap();
@@ -29,7 +29,7 @@ pub fn bench_diamond_pattern(c: &mut Criterion) {
.add_task(task_fn::<(i32, i32), _, _>(|(x, y): (&i32, &i32)| x + y))
.depends_on((&b, &c));
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap))
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() })
.await
.unwrap();
dag.get(d).unwrap()
+2 -2
View File
@@ -3,7 +3,7 @@
//! Extract → Transform → Validate → Load pattern
use criterion::Criterion;
use futures::FutureExt;
pub fn bench_etl_pipeline(c: &mut Criterion) {
let rt = tokio::runtime::Runtime::new().unwrap();
@@ -70,7 +70,7 @@ pub fn bench_etl_pipeline(c: &mut Criterion) {
}))
.depends_on(validate);
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap))
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() })
.await
.unwrap();
dag.get(load).unwrap()
+2 -2
View File
@@ -3,7 +3,7 @@
//! 10,000 independent tasks to test scaling
use criterion::Criterion;
use futures::FutureExt;
pub fn bench_large_scale(c: &mut Criterion) {
let rt = tokio::runtime::Runtime::new().unwrap();
@@ -22,7 +22,7 @@ pub fn bench_large_scale(c: &mut Criterion) {
dag.add_task(task_fn::<(), _, _>(move |_: ()| i * 2));
}
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap))
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() })
.await
.unwrap();
})
+2 -2
View File
@@ -3,7 +3,7 @@
//! Simple chain of tasks: A → B → C → D → E
use criterion::Criterion;
use futures::FutureExt;
pub fn bench_linear_pipeline(c: &mut Criterion) {
let rt = tokio::runtime::Runtime::new().unwrap();
@@ -31,7 +31,7 @@ pub fn bench_linear_pipeline(c: &mut Criterion) {
.add_task(task_fn::<i32, _, _>(|&x: &i32| x * 3))
.depends_on(d);
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap))
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() })
.await
.unwrap();
dag.get(e).unwrap()
+2 -2
View File
@@ -4,7 +4,7 @@
use criterion::Criterion;
use dagx::TaskHandle;
use futures::FutureExt;
pub fn bench_wide_fanout(c: &mut Criterion) {
let rt = tokio::runtime::Runtime::new().unwrap();
@@ -25,7 +25,7 @@ pub fn bench_wide_fanout(c: &mut Criterion) {
.depends_on(source);
}
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap))
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() })
.await
.unwrap();
})