mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-18 00:00:09 +02:00
committed by
Toby Lawrence
parent
7dc6404726
commit
82c5baa09b
@@ -45,7 +45,7 @@ mod imp {
|
||||
mod imp {
|
||||
use std::sync::Mutex;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AtomicU64 {
|
||||
inner: Mutex<u64>,
|
||||
|
||||
@@ -198,7 +198,7 @@ struct Data<T> {
|
||||
/// Next entry in the stack
|
||||
next: Option<usize>,
|
||||
|
||||
/// Previous entry in the stac
|
||||
/// Previous entry in the stack
|
||||
prev: Option<usize>,
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ impl<T> DelayQueue<T> {
|
||||
/// use tokio_timer::timer::Handle;
|
||||
///
|
||||
/// let handle = Handle::default();
|
||||
/// let deplay_queue: DelayQueue<u32> = DelayQueue::with_capacity_and_handle(0, &handle);
|
||||
/// let delay_queue: DelayQueue<u32> = DelayQueue::with_capacity_and_handle(0, &handle);
|
||||
/// ```
|
||||
pub fn with_capacity_and_handle(capacity: usize, handle: &Handle) -> DelayQueue<T> {
|
||||
DelayQueue {
|
||||
@@ -282,7 +282,7 @@ impl<T> DelayQueue<T> {
|
||||
///
|
||||
/// The return value represents the insertion and is used at an argument to
|
||||
/// [`remove`] and [`reset`]. Note that [`Key`] is token and is reused once
|
||||
/// `value` is removed from the queue eitheer by calling [`poll`] after
|
||||
/// `value` is removed from the queue either by calling [`poll`] after
|
||||
/// `when` is reached or by calling [`remove`]. At this point, the caller
|
||||
/// must take care to not use the returned [`Key`] again as it may reference
|
||||
/// a different item in the queue.
|
||||
@@ -350,7 +350,7 @@ impl<T> DelayQueue<T> {
|
||||
///
|
||||
/// The return value represents the insertion and is used at an argument to
|
||||
/// [`remove`] and [`reset`]. Note that [`Key`] is token and is reused once
|
||||
/// `value` is removed from the queue eitheer by calling [`poll`] after
|
||||
/// `value` is removed from the queue either by calling [`poll`] after
|
||||
/// `when` is reached or by calling [`remove`]. At this point, the caller
|
||||
/// must take care to not use the returned [`Key`] again as it may reference
|
||||
/// a different item in the queue.
|
||||
@@ -485,7 +485,7 @@ impl<T> DelayQueue<T> {
|
||||
///
|
||||
/// delay_queue.reset_at(&key, Instant::now() + Duration::from_secs(10));
|
||||
///
|
||||
/// // "foo"is now scheduledto be returned in 10 seconds
|
||||
/// // "foo"is now scheduled to be returned in 10 seconds
|
||||
/// # }
|
||||
/// ```
|
||||
pub fn reset_at(&mut self, key: &Key, when: Instant) {
|
||||
@@ -541,7 +541,7 @@ impl<T> DelayQueue<T> {
|
||||
///
|
||||
/// delay_queue.reset(&key, Duration::from_secs(10));
|
||||
///
|
||||
/// // "foo"is now scheduledto be returned in 10 seconds
|
||||
/// // "foo"is now scheduled to be returned in 10 seconds
|
||||
/// # }
|
||||
/// ```
|
||||
pub fn reset(&mut self, key: &Key, timeout: Duration) {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//!
|
||||
//! * [`Timeout`]: Wraps a future or stream, setting an upper bound to the
|
||||
//! amount of time it is allowed to execute. If the future or stream does not
|
||||
//! completee in time, then it is canceled and an error is returned.
|
||||
//! complete in time, then it is canceled and an error is returned.
|
||||
//!
|
||||
//! * [`DelayQueue`]: A queue where items are returned once the requested delay
|
||||
//! has expired.
|
||||
|
||||
@@ -84,7 +84,7 @@ where
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `when`: is the instant at which the the entry should be fired. It is
|
||||
/// * `when`: is the instant at which the entry should be fired. It is
|
||||
/// represented as the number of milliseconds since the creation
|
||||
/// of the timing wheel.
|
||||
///
|
||||
@@ -98,9 +98,9 @@ where
|
||||
///
|
||||
/// `Err(Elapsed)` indicates that `when` represents an instant that has
|
||||
/// already passed. In this case, the caller should fire the timeout
|
||||
/// immediateely.
|
||||
/// immediately.
|
||||
///
|
||||
/// `Err(Invalid)` indicates an invalid `when` argumeent as been supplied.
|
||||
/// `Err(Invalid)` indicates an invalid `when` argument as been supplied.
|
||||
pub fn insert(&mut self, when: u64, item: T::Owned, store: &mut T::Store)
|
||||
-> Result<(), (T::Owned, InsertError)>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user