def _maybePauseProducer(self):
        """
        Possibly pause a producer, if there is one and the send buffer is full.
        """
        # If we are responsible for pausing our producer,
        if self.producer is not None and self.streamingProducer:
            # and our buffer is full,
            if self._isSendBufferFull():
                # pause it.
                self.producerPaused = True
                self.producer.pauseProducing()

        Possibly pause a producer, if there is one and the send buffer is full.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/abstract.py