

def _send_to_address(self, invocation, address, ignore_heartbeat=False):
    try:
        conn = self._client.connection_manager.connections[address]
        self._send(invocation, conn, ignore_heartbeat)
    except KeyError:
        if (self._client.lifecycle.state != LIFECYCLE_STATE_CONNECTED):
            self._handle_exception(invocation, IOError('Client is not in connected state'))
        else:

            def on_connect(f):
                if f.is_success():
                    self._send(invocation, f.result(), ignore_heartbeat)
                else:
                    self._handle_exception(invocation, f.exception(), f.traceback())
            conn._client.connection_manager.get_or_connect(address).continue_with(on_connect)

dataset/ETHPy150Open hazelcast/hazelcast-python-client/hazelcast/invocation.py InvocationService._send_to_address/VarMisuse@143/202 `self`->`conn`