code: def on_client_disconnect(self, client_conn, msg, connection_valid):
          
          f = tornado_Future()
          @gen.coroutine
          def remove_strategies():
              self.clear_strategies(client_conn, remove_client=True)
              if connection_valid:
                  client_conn.inform(Message.inform("disconnect", msg))
                  yield client_conn.flush_on_close()
  
          try:
              self._client_conns.remove(client_conn)
              self.ioloop.add_callback(lambda: chain_future(remove_strategies(), f))
          except Exception:
              f.set_exc_info(sys.exc_info())
          return f
docs: Inform client it is about to be disconnected.
  
          Parameters
          ----------
          client_conn : ClientConnection object
              The client connection being disconnected.
          msg : str
              Reason client is being disconnected.
          connection_valid : bool
              True if connection is still open for sending,
              False otherwise.
  
          Returns
          -------
          Future that resolves when the client connection can be closed.