Struct syncbox::DelayQueue [] [src]

pub struct DelayQueue<T: Delayed + Send> {
    // some fields omitted
}

An unbounded blocking queue of delayed values. When a value is pushed onto the queue, a delay is included. The value will only be able to be popped off once the specified delay has expired. The head of the queue is the value whose delay is expired and furthest in the past.

Methods

impl<T: Delayed + Send> DelayQueue<T>

fn new() -> DelayQueue<T>

Constructs a new DelayQueue.

fn poll_timeout(&self, timeout: Duration) -> Option<T>

Takes from the queue, blocking for up to timeout.

Trait Implementations

impl<T: Delayed + Send> Queue<T> for DelayQueue<T>

fn poll(&self) -> Option<T>

fn is_empty(&self) -> bool

fn offer(&self, e: T) -> Result<(), T>

impl<T: Delayed + Send> SyncQueue<T> for DelayQueue<T>

fn take(&self) -> T

fn put(&self, e: T)

impl<T: Delayed + Send> Clone for DelayQueue<T>

fn clone(&self) -> DelayQueue<T>

1.0.0fn clone_from(&mut self, source: &Self)