Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start using fbinit-provided async runtime
Summary: Another take on unifying async runtimes throughout the target_determinator/*. As was pointed out in D60313119, the blast radius of supertd changes is large, so instead of converting supertd to async and then following up with dependencies one by one, doing it in the opposite direction. Until we eliminate all ad-hoc runtimes in dependencies, supertd will stay sync, wrapping newly-async stuff in separate block_on's. Then we just switch to one top-level runtime. Below is the copy of D60313119 summary. We're spawning tokio runtimes in many places whenever we need to interact with async code. This leads to many weird and confusing things, like creating nested runtimes running on different threads as in [configerator_td](https://www.internalfb.com/code/fbsource/[ea9e394c36cb]/fbcode/target_determinator/configerator_td/src/lib.rs?lines=28) running scheduler which in turn creates 2 separate runtimes. CLI foundation provides idiomatic way of creating tokio runtime via fbinit::main (or cli::main), and given that we almost always just execute stuff linearly, .await'ing on everything, using it seems like a good idea. Reviewed By: rjbailey Differential Revision: D60521049 fbshipit-source-id: c44874da2c346611523921e96825e5003a29ea40
- Loading branch information