def put(self, obj):
        """
        Add an object to this queue.

        @raise QueueOverflow: Too many objects are in this queue.
        """
        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()

        Add an object to this queue.

        @raise QueueOverflow: Too many objects are in this queue.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/defer.py