public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ServiceQueryOptions obj) { for (java.util.Map.Entry<String, Object> member : json) { switch (member.getKey()) { case "blockingOptions": if (member.getValue() instanceof JsonObject) { obj.setBlockingOptions(new io.vertx.ext.consul.BlockingQueryOptions((JsonObject)member.getValue())); } break; case "near": if (member.getValue() instanceof String) { obj.setNear((String)member.getValue()); } break; case "tag": if (member.getValue() instanceof String) { obj.setTag((String)member.getValue()); } break; } } }
@Override void wait(long index, Handler<AsyncResult<State<ServiceEntryList>>> handler) { BlockingQueryOptions bOpts = new BlockingQueryOptions().setWait(BLOCKING_WAIT).setIndex(index); ServiceQueryOptions sOpts = new ServiceQueryOptions().setBlockingOptions(bOpts); consulClient.healthServiceNodesWithOptions(service, false, sOpts, h -> handler.handle(h.map(services -> new State<ServiceEntryList>(services, services.getIndex())))); } }
waitBlockingQuery(latch, 10, list1.getIndex(), (idx, fut) -> { ServiceQueryOptions options = new ServiceQueryOptions() .setBlockingOptions(new BlockingQueryOptions().setIndex(idx)); ctx.readClient().healthServiceNodesWithOptions("service", true, options, h -> { waitComplete(vertx, fut, h.result().getIndex(), h.result().getList().size() == 1);