rmanoka / async-scoped

A scope for async_std and tokio to spawn non-static futures
117 stars 14 forks source link

Simplify Scope active futures tracking #25

Closed akoshelev closed 7 months ago

akoshelev commented 7 months ago

We don't seem to have a need to separately track the number of active futures as FuturesOrdered can provide this information to us.

Tested by running unit tests for both runtimes

> cargo test --features "use-async-std"
...
test tests::backpressure ... ignored
test tests::test_empty_scope ... ok
test tests::test_cancellation_works ... ok
test tests::test_scope_and_block ... ok
test tests::test_scope ... ok
test tests::test_scope_and_collect ... ok
test tests::scope_lifetime ... ok
test tests::test_scope_and_block_spawn_blocking ... ok
test tests::test_async_deadlock ... ok
test tests::test_cancellation_completeness ... ok
test tests::test_ordered_collect ... ok
test tests::scope_async ... ok
test tests::test_cancellation_soundness ... ok

test result: ok. 12 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.62s

> cargo test --features "use-tokio"
...
test tests::backpressure ... ignored
test tests::test_empty_scope ... ok
test tests::scope_lifetime ... ok
test tests::test_scope ... ok
test tests::test_cancellation_works ... ok
test tests::test_scope_and_block ... ok
test tests::test_scope_and_collect ... ok
test tests::test_async_deadlock ... ok
test tests::test_scope_and_block_spawn_blocking ... ok
test tests::test_async_deadlock_tokio ... ok
test tests::test_cancellation_completeness ... ok
test tests::test_ordered_collect ... ok
test tests::scope_async ... ok
test tests::test_cancellation_soundness ... ok

test result: ok. 13 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.61s