def publish_exception(self, exception: BaseException) -> None:
        """Publishes an exception to all outstanding futures."""
        for future in self._subscribers.values():
            if not future.done():
                future.set_exception(exception)
        self._subscribers.clear()
Publishes an exception to all outstanding futures.
cirq-google/cirq_google/engine/stream_manager.py