Skip to content

Commit

Permalink
time: document that timeouts check only before poll (#5126)
Browse files Browse the repository at this point in the history
  • Loading branch information
rthomas committed Oct 29, 2022
1 parent cbbf81b commit 3b5ef4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tokio/src/time/timeout.rs
Expand Up @@ -21,6 +21,10 @@ use std::task::{self, Poll};
/// value is returned. Otherwise, an error is returned and the future is
/// canceled.
///
/// Note that the timeout is checked before polling the future, so if the future
/// does not yield during execution then it is possible for the future to complete
/// and exceed the timeout _without_ returning an error.
///
/// This function returns a future whose return type is [`Result`]`<T,`[`Elapsed`]`>`, where `T` is the
/// return type of the provided future.
///
Expand Down

0 comments on commit 3b5ef4e

Please sign in to comment.