We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Interval::reset_immediately()
Version
v1.38.1
Platform
macOS 15 on arm64
arm64
Darwin 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:25 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6030 arm64 arm Darwin
Description
Interval::reset_immediately() is not immediately ready. It appears to take 1 millisecond (the timer resolution).
#[tokio::test] async fn test_reset_immediately() { use futures::FutureExt as _; use tokio::time::{Duration, Instant}; let mut ticker = tokio::time::interval(Duration::from_secs(1)); ticker.tick().await; ticker.reset_immediately(); assert!(ticker.tick().now_or_never().is_some()); // fails // Time a reset. Outputs > 1 millisecond. let start = Instant::now(); ticker.reset_immediately(); ticker.tick().await; println!("{}", Instant::now().duration_since(start).as_secs_f64()) }
I expect the future to be immediately ready.
The text was updated successfully, but these errors were encountered:
WalAcceptor
This is due to duration-zero sleeps sleeping until the next tick. Closing as duplicate of #6866.
Sorry, something went wrong.
No branches or pull requests
Version
v1.38.1
Platform
macOS 15 on
arm64
Description
Interval::reset_immediately()
is not immediately ready. It appears to take 1 millisecond (the timer resolution).I expect the future to be immediately ready.
The text was updated successfully, but these errors were encountered: