private void getMostRecentState() throws InterruptedException { boolean successful = false; while (!successful && !aborted.get()) { ClientState bestClient = getBestClient(clientStates); if (bestClient == null) { successful = true; continue; } Services.Client client = connections.getClient0(bestClient.getLocation()); if (client == null) { clients.remove(bestClient.getLocation()); continue; } Rpc rpc = rpcf.create(); FullStateCallback done = new FullStateCallback(); client.getFullState(rpc, Empty.getDefaultInstance(), done); rpc.await(); successful = rpc.isOk(); if (!successful) { clients.remove(bestClient.getLocation()); } } }
@Override public void run(T unused) { if (rpc.failed()) { removeParticipant(participantLocation); } }