code: async def pause_writing(self):
          
          self._restart_writer = False
          if self._writer_task:
              self._writer_task.remove_done_callback(self.restart_writing)
              self._writer_task.cancel()
              await self._writer_task
              await asyncio.sleep(0, loop=self._loop)
docs: Pause writing.