def stopStreaming(self):
        """
        This should be called by the consumer when the producer is
        unregistered.

        Stop streaming data to the consumer.
        """
        if self._finished:
            return
        self._finished = True
        self._coopTask.stop()

        This should be called by the consumer when the producer is
        unregistered.

        Stop streaming data to the consumer.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/_producer_helpers.py