4 ms·
What library are you using? The pattern you are trying to achieve should be achievable in principle. This pattern is commonly called "scoped" threads (or "scope
by GolDDranks 6y ago
What library are you using? The pattern you are trying to achieve should be achievable in principle. This pattern is commonly called "scoped" threads (or "scoped" async tasks in this case) in the community.
The problem might be that if the executor you are using doesn't guarantee in its type signature, that the task you are trying to launch doesn't outlive the lexical scope there, the compile gets rightfully angry. There are some executors that guarantee that; see here: https://docs.rs/async-scoped/0.4.1/async_scoped/ https://docs.rs/async-scoped/0.4.1/async_scoped/