'Attempt to retrieve and remove an object from the queue.
@return: a L{Deferred} which fires with the next object available in
the queue.
@raise QueueUnderflow: Too many (more than C{backlog})
L{Deferred}s are already waiting for an object from this queue.'

def get(self):

    if self.pending:
        return succeed(self.pending.pop(0))
    elif ((self.backlog is None) or (len(self.waiting) < self.backlog)):
        d = Deferred(canceller=self._cancelGet)
        self.waiting.append(d)
        return d
    else:
        raise QueueUnderflow()
