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 Interval::reset method #4248

Merged
merged 1 commit into from Nov 23, 2021

Conversation

oblique
Copy link
Contributor

@oblique oblique commented Nov 19, 2021

Motivation

Some networking protocols need heartbeat mechanism and Interval makes it very easy to implement it. However if the protocol requires the heartbeat to be send only if the connection is idle, then there is no way to reset the Interval when is not.

Solution

Add Interval::reset method

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-time Module: tokio/time labels Nov 22, 2021
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.

This seems reasonable.

@Darksonn Darksonn merged commit 347c0cd into tokio-rs:master Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-time Module: tokio/time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants