Skip to content

async #6

@Eh2406

Description

@Eh2406

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions