-
Notifications
You must be signed in to change notification settings - Fork 0
Description
There are use cases where getting the available versions and the dependencies for a version require async operations like network requests. cc rust-lang/cargo#8890 and npm api.
We should make sure that this is doable with the dependency_provider trait before 1.0.
I discussed this problem with @jonhoo. It is possible to make it work with the existing (0.2) api. This involves having the implementer store a pointer to the runtime in its new method. This allows choose_package_version
to spawn new request for packages in potential_packages
that are not yet in flight, then block on a FuturesUnordered
of all of them.
How ergonomic is this? Do we need a helper function so that all implementers don't have to make it up themselves? Do we need to redesign the API to be async aware? We won't know until someone tries it.