'Remove and return an element from the queue, or this queue has been
closed raise the Closed exception.'

def get(self):

    while True:
        self._not_empty.acquire()
        while ((len(self._queue) == 0) and (not self._closed)):
            self._not_empty.wait()
        if self._closed:
            self._not_empty.release()
            return None
        (head, insert_time) = self._queue[0]
        self._not_empty.release()
        time_left = ((insert_time + self.delay) - time.time())
        while (time_left > 0):
            time.sleep(time_left)
            time_left = ((insert_time + self.delay) - time.time())
        self._lock.acquire()
        try:
            if ((len(self._queue) > 0) and (self._queue[0][0] is head)):
                self._queue.popleft()
                return head
        finally:
            self._lock.release()
