summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMarkus Westerlind <marwes91@gmail.com>2020-07-10 18:11:01 +0200
committerGitHub <noreply@github.com>2020-07-10 09:11:01 -0700
commitf69e5bfb87eda2b8de9b762b9280f1733cdaa096 (patch)
tree8c365b86ef583dd85f465a139474bbdf2f822c96 /examples
parent2aa8751261870875d2664ac6515026b9c8d87ee4 (diff)
fix: Update the docs of "pause" to state that time will still advance (#2647)
* doc: Update the docs of "pause" to state that time will still advance This was changed in #2059. This had me extremely confused for some time as my timeouts fired immediately, without the wrapped future that were waiting on IO to actually run long enough. I am not sure about the exact wording here but this had me very confused for some time. Deprecating "pause" and giving it a more accurate name may be a good idea as well. ```rust async fn timeout_advances() { time::pause(); timeout(ms(1), async { // Change to 1 and the this future resolve, 2 or // more and the timeout resolves for _ in 0..2 { tokio::task::yield_now().await } }) .await .unwrap(); } ``` * Update tokio/src/time/clock.rs Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Alice Ryhl <alice@ryhl.io>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions