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

Add FutureExt::wait #1007

Closed
yoshuawuyts opened this issue Mar 14, 2022 · 1 comment
Closed

Add FutureExt::wait #1007

yoshuawuyts opened this issue Mar 14, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@yoshuawuyts
Copy link
Contributor

Ref: smol-rs/async-task#16

Design Sketch

trait FutureExt: Future {
    /// Wait for the `Future` to complete execution.
    pub fn wait(self) -> <Self as Future>::Output;
}
@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Mar 14, 2022
@yoshuawuyts
Copy link
Contributor Author

Rationale here: smol-rs/async-task#16 (comment), but after having researched it further I no longer think this is a good idea. Instead if we want to optimize specific sync variants of futures we should be able to provide specializations for those futures in thread::block_on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant