Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize/parallelize target detection #192

Merged
merged 2 commits into from
Jun 23, 2022
Merged

Optimize/parallelize target detection #192

merged 2 commits into from
Jun 23, 2022

Conversation

NobodyXu
Copy link
Member

@NobodyXu NobodyXu commented Jun 23, 2022

This PR adds get_desired_targets a newtype DesiredTargets so that if opts.targets is None, the future returned by detect_targets can be run in parallel by using tokio::spawn with other async code in entry, such as fetch_crate_cratesio.

tokio::sync::OnceCell is used instead of simply polling tokio::task::JoinHandle because OnceCell can be used in #175 while the later cannot.

NobodyXu added 2 commits June 23, 2022 14:46
so that if `opts.targets` is `None`, the future returned by
`detect_targets` can be run in parallel by using `tokio::spawn` with
other async code in `entry`, such as `fetch_crate_cratesio`.

Signed-off-by: Jiahao XU <[email protected]>
instead of `detect_targets`, so that if `opts.targets` is
`None`, the future returned by `detect_targets` can be run
in parallel by using `tokio::spawn` with other async code
in `entry`, such as `fetch_crate_cratesio`.

Signed-off-by: Jiahao XU <[email protected]>
@NobodyXu NobodyXu marked this pull request as ready for review June 23, 2022 05:01
@passcod passcod merged commit cc8144e into cargo-bins:main Jun 23, 2022
@NobodyXu NobodyXu deleted the optimize/parallelize-target-detection branch June 23, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants