'Add an object to this queue.
@raise QueueOverflow: Too many objects are in this queue.'

def put(self, obj):

    if self.waiting:
        self.waiting.pop(0).callback(obj)
    elif ((self.size is None) or (len(self.pending) < self.size)):
        self.pending.append(obj)
    else:
        raise QueueOverflow()
