def wait_stop(self):
        """
        Stop the stream and wait for it to stop.

        See :meth:`stop` for the general stopping conditions. You can assume
        that :meth:`stop` is the first thing this coroutine calls.
        """
        if not self.running:
            return
        self.stop()
        try:
            yield from self._task
        except asyncio.CancelledError:
            pass
Stop the stream and wait for it to stop.

        See :meth:`stop` for the general stopping conditions. You can assume
        that :meth:`stop` is the first thing this coroutine calls.