(self, item, duration, count_for_size)
Put item onto queue with duration in seconds.
        Items with duration None remain until next item is put.
Put item onto queue with duration in seconds.
        Items with duration None remain until next item is put.
Put item onto queue with duration in seconds . Items with duration None remain until next item is put .
def put(self, item, duration, count_for_size):
        """
        Put item onto queue with duration in seconds.
        Items with duration None remain until next item is put.
        """
        self._check_expired()
        # drop looping elements
        try:
            if self._deque[-1][1] is None:
                self._deque.pop()
        except IndexError:
            pass
        if duration is None:
            expiry = None
        else:
            last = self._deque[-1][1] if self._deque else datetime.datetime.now()
            expiry = max(last, datetime.datetime.now()) + datetime.timedelta(seconds=duration)
        self._deque.append((item, expiry, count_for_size))
def put ( self , item , duration , count_for_size ) : self . _check_expired ( ) # drop looping elements try : if self . _deque [ - 1 ] [ 1 ] is None : self . _deque . pop ( ) except IndexError : pass if duration is None : expiry = None else : last = self . _deque [ - 1 ] [ 1 ] if self . _deque else datetime . datetime . now ( ) expiry = max ( last , datetime . datetime . now ( ) ) + datetime . timedelta ( seconds = duration ) self . _deque . append ( ( item , expiry , count_for_size ) )