def flush(self):
        if self.handler is None:
            return

        if not self.send_queue:
            return

        self.handler.send_messages(self.send_queue)

        self.send_queue = []

        # If session was closed, detach connection
        if self.is_closed and self.handler is not None:
            self.handler.session_closed()

    # Close connection with all endpoints or just one endpoint
Flush message queue if there's an active connection running
dataset/ETHPy150Open mrjoes/tornadio2/tornadio2/session.py/Session.flush