/** * Returns the services registered in a datacenter * This is blocking query unlike {@link io.vertx.rxjava.ext.consul.ConsulClient#catalogServices} * @param options the blocking options * @param resultHandler will be provided with list of services * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient catalogServicesWithOptions(BlockingQueryOptions options, Handler<AsyncResult<ServiceList>> resultHandler) { delegate.catalogServicesWithOptions(options, resultHandler); return this; }
@Override public ConsulService catalogServicesWithOptions(BlockingQueryOptions options, Handler<AsyncResult<ServiceList>> resultHandler) { consulClient.catalogServicesWithOptions(options, resultHandler); return this; }
/** * Returns the services registered in a datacenter * This is blocking query unlike {@link io.vertx.rxjava.ext.consul.ConsulClient#catalogServices} * @param options the blocking options * @param resultHandler will be provided with list of services * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient catalogServicesWithOptions(BlockingQueryOptions options, Handler<AsyncResult<ServiceList>> resultHandler) { delegate.catalogServicesWithOptions(options, resultHandler); return this; }
public static io.vertx.ext.consul.ConsulClient catalogServicesWithOptions(io.vertx.ext.consul.ConsulClient j_receiver, java.util.Map<String, Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) { io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.catalogServicesWithOptions(options != null ? new io.vertx.ext.consul.BlockingQueryOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.consul.ServiceList>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.ext.consul.ServiceList> ar) { resultHandler.handle(ar.map(event -> event != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(event.toJson()) : null)); } } : null)); return j_receiver; } public static io.vertx.ext.consul.ConsulClient catalogNodeServices(io.vertx.ext.consul.ConsulClient j_receiver, java.lang.String node, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) {
@Override void wait(long index, Handler<AsyncResult<State<ServiceList>>> handler) { BlockingQueryOptions options = new BlockingQueryOptions().setWait(BLOCKING_WAIT).setIndex(index); consulClient.catalogServicesWithOptions(options, h -> handler.handle(h.map(services -> new State<ServiceList>(services, services.getIndex())))); } }
@Test public void catalogServicesBlocking() throws InterruptedException { testServicesBlocking(h -> ctx.readClient().catalogServices(h), (opts, h) -> ctx.readClient().catalogServicesWithOptions(opts, h)); }