code: async def disconnect(self):
          
          self._connected = False
  
          await helpers._cancel(
              self._log,
              send_task=self._send_task,
              recv_task=self._recv_task
          )
  
          if self._writer:
              self._writer.close()
              if sys.version_info >= (3, 7):
                  await self._writer.wait_closed()
docs: Disconnects from the server, and clears
          pending outgoing and incoming messages.