pub fn push(&mut self, item: T) {
        let mut queue = self.shared_data.queue.lock().unwrap();

        {
            // If the new item goes to the head of the queue then notify consumers
            let cur_head = queue.peek();
            if (cur_head == None)
                || (item.delayed_until() < cur_head.unwrap().delayed.delayed_until())
            {
                self.shared_data.condvar_new_head.notify_one();
            }
        }

        queue.push(Entry::new(item));
    }
/// Pushes an item onto the queue.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use delay_queue::{Delay, DelayQueue};
/// use std::time::Duration;
///
/// let mut queue = DelayQueue::new();
/// queue.push(Delay::for_duration("2nd", Duration::from_secs(5)));
/// ```
Pushes an item onto the queue.
Pushes an item onto the queue .
pub fn push(&mut self, item: T) {
        let mut queue = self.shared_data.queue.lock().unwrap();
        {
            // If the new item goes to the head of the queue then notify consumers
            let cur_head = queue.peek();
            if (cur_head == None)
                || (item.delayed_until() < cur_head.unwrap().delayed.delayed_until())
            {
                self.shared_data.condvar_new_head.notify_one();
            }
        }
        queue.push(Entry::new(item));
    }
pub fn push ( & mut self , item : T ) { let mut queue = self . shared_data . queue . lock ( ) . unwrap ( ) ; { // If the new item goes to the head of the queue then notify consumers let cur_head = queue . peek ( ) ; if ( cur_head == None ) || ( item . delayed_until ( ) < cur_head . unwrap ( ) . delayed . delayed_until ( ) ) { self . shared_data . condvar_new_head . notify_one ( ) ; } } queue . push ( Entry :: new ( item ) ) ; }
Pushes an item onto the queue.
Pushes an item onto the queue .
&mut self
item
T
examples
Basic usage.

```
use delay_queue::{Delay, DelayQueue};
use std::time::Duration.

let mut queue = DelayQueue::new();
queue.push(Delay::for_duration("2nd", Duration::from_secs(5)));
```
Basic usage . ` ` ` use delay_queue :: { Delay DelayQueue } ; use std :: time :: Duration . let mut queue = DelayQueue :: new () ; queue . push ( Delay :: for_duration ( " 2nd " Duration :: from_secs ( 5 ))) ; ` ` `