summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync
diff options
context:
space:
mode:
authorJuan Alvarez <j@yabit.io>2020-10-08 22:35:12 -0500
committerGitHub <noreply@github.com>2020-10-08 20:35:12 -0700
commit60d81bbe10faf344ea18438a1c5ecb9173e6ec52 (patch)
tree4a6b64401944b62ffa872147e5738eb28e70d4ec /tokio/src/sync
parentb704c53b9cc76eaf8c9c6585f8444c4515d27728 (diff)
time: rename `Delay` future to `Sleep` (#2932)
Diffstat (limited to 'tokio/src/sync')
-rw-r--r--tokio/src/sync/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs
index 294b0b50..4919ad8e 100644
--- a/tokio/src/sync/mod.rs
+++ b/tokio/src/sync/mod.rs
@@ -359,11 +359,11 @@
//! let mut conf = rx.borrow().clone();
//!
//! let mut op_start = Instant::now();
-//! let mut delay = time::sleep_until(op_start + conf.timeout);
+//! let mut sleep = time::sleep_until(op_start + conf.timeout);
//!
//! loop {
//! tokio::select! {
-//! _ = &mut delay => {
+//! _ = &mut sleep => {
//! // The operation elapsed. Restart it
//! op.set(my_async_operation());
//!
@@ -371,14 +371,14 @@
//! op_start = Instant::now();
//!
//! // Restart the timeout
-//! delay = time::sleep_until(op_start + conf.timeout);
+//! sleep = time::sleep_until(op_start + conf.timeout);
//! }
//! _ = rx.changed() => {
//! conf = rx.borrow().clone();
//!
//! // The configuration has been updated. Update the
-//! // `delay` using the new `timeout` value.
-//! delay.reset(op_start + conf.timeout);
+//! // `sleep` using the new `timeout` value.
+//! sleep.reset(op_start + conf.timeout);
//! }
//! _ = &mut op => {
//! // The operation completed!