Poll: Async/Await, let's talk about executors!

You can create something very similar to this by wrapping a spawner in another one that tracks all sub-futures it spawns. Without some form of AsyncDrop you would have to explicitly join that spawner to wait for all the sub-futures to complete, but maybe there would be a way to deal with it via some sort of closure based API.

Here's a non-trivial example using a wrapper nursery to scope some tasks while using a top-level spawner to actually run them: Rust Playground

1 Like