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

time: add Future::timeout method via FutureExt #6276

Merged

Conversation

evanrittenhouse
Copy link
Contributor

@evanrittenhouse evanrittenhouse commented Jan 8, 2024

Motivation

Closes #6047

Solution

We simply add an extension trait, wrapping the existing time::timeout method to reduce duplication.

@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-time Module: tokio/time labels Jan 11, 2024
@evanrittenhouse evanrittenhouse force-pushed the evanrittenhouse/timeout_utility branch from f219fbc to cc94be2 Compare January 15, 2024 02:51
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the last nit. Otherwise LGTM.

tokio-util/src/time/mod.rs Outdated Show resolved Hide resolved
@evanrittenhouse evanrittenhouse force-pushed the evanrittenhouse/timeout_utility branch from cc94be2 to 73fa171 Compare January 16, 2024 01:14
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Darksonn Darksonn merged commit bfd7b08 into tokio-rs:master Jan 16, 2024
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-time Module: tokio/time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Future::timeout() method
3 participants