docs: def expire(self, current_time=None):
          """Expire any old entries
  
          `current_time`
              Optional time to be used to clean up queue (can be used in unit tests)
          """
          if not self._queue:
              return
  
          if current_time is None:
              current_time = time()
  
          while self._queue:
              # Get top most item
              top = self._queue[0]
  
              # Early exit if item was not promoted and its expiration time
              # is greater than now.
              if top.promoted is None and top.expiry_date > current_time:
                  break
  
              # Pop item from the stack
              top = heappop(self._queue)
  
              need_reschedule = (top.promoted is not None
                                 and top.promoted > current_time)
  
              # Give chance to reschedule
              if not need_reschedule:
                  top.promoted = None
                  top.on_delete(False)
  
                  need_reschedule = (top.promoted is not None
                                     and top.promoted > current_time)
  
              # If item is promoted and expiration time somewhere in future
              # just reschedule it
              if need_reschedule:
                  top.expiry_date = top.promoted
                  top.promoted = None
                  heappush(self._queue, top)
              else:
                  del self._items[top.session_id]