@Override public ConsulService listEventsWithOptions(EventListOptions options, Handler<AsyncResult<EventList>> resultHandler) { consulClient.listEventsWithOptions(options, resultHandler); return this; }
/** * Returns the most recent events known by the agent. * This is blocking query unlike {@link io.vertx.rxjava.ext.consul.ConsulClient#listEvents}. However, the semantics of this endpoint * are slightly different. Most blocking queries provide a monotonic index and block until a newer index is available. * This can be supported as a consequence of the total ordering of the consensus protocol. With gossip, * there is no ordering, and instead <code>X-Consul-Index</code> maps to the newest event that matches the query. * <p> * In practice, this means the index is only useful when used against a single agent and has no meaning globally. * Because Consul defines the index as being opaque, clients should not be expecting a natural ordering either. * @param options the blocking options * @param resultHandler will be provided with list of events * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient listEventsWithOptions(EventListOptions options, Handler<AsyncResult<EventList>> resultHandler) { delegate.listEventsWithOptions(options, resultHandler); return this; }
/** * Returns the most recent events known by the agent. * This is blocking query unlike {@link io.vertx.rxjava.ext.consul.ConsulClient#listEvents}. However, the semantics of this endpoint * are slightly different. Most blocking queries provide a monotonic index and block until a newer index is available. * This can be supported as a consequence of the total ordering of the consensus protocol. With gossip, * there is no ordering, and instead <code>X-Consul-Index</code> maps to the newest event that matches the query. * <p> * In practice, this means the index is only useful when used against a single agent and has no meaning globally. * Because Consul defines the index as being opaque, clients should not be expecting a natural ordering either. * @param options the blocking options * @param resultHandler will be provided with list of events * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient listEventsWithOptions(EventListOptions options, Handler<AsyncResult<EventList>> resultHandler) { delegate.listEventsWithOptions(options, resultHandler); return this; }
public static io.vertx.ext.consul.ConsulClient listEventsWithOptions(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.listEventsWithOptions(options != null ? new io.vertx.ext.consul.EventListOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.consul.EventList>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.ext.consul.EventList> 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 registerService(io.vertx.ext.consul.ConsulClient j_receiver, java.util.Map<String, Object> serviceOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler) {
@Override void wait(long index, Handler<AsyncResult<State<EventList>>> handler) { BlockingQueryOptions bOpts = new BlockingQueryOptions().setWait(BLOCKING_WAIT).setIndex(index); EventListOptions eOpts = new EventListOptions().setBlockingOptions(bOpts).setName(event); consulClient.listEventsWithOptions(eOpts, h -> handler.handle(h.map(events -> new State<EventList>(events, events.getIndex())))); } }
.count(); tc.assertEquals(cnt1, (long) 1); ctx.writeClient().listEventsWithOptions(new EventListOptions().setName(name2), tc.asyncAssertSuccess(list2 -> { tc.assertEquals(list2.getList().size(), 0); Async async = tc.async(2); blockingQueryOptions.setWait("2s"); ctx.writeClient().listEventsWithOptions(new EventListOptions().setBlockingOptions(blockingQueryOptions), tc.asyncAssertSuccess(h -> { List<String> names = h.getList().stream().map(Event::getName).collect(Collectors.toList()); if (timeout) { tc.assertEquals(async.count(), timeout ? 1 : 2); ctx.writeClient().fireEvent(name2, tc.asyncAssertSuccess(ev -> { ctx.writeClient().listEventsWithOptions(new EventListOptions().setName(name2), tc.asyncAssertSuccess(list3 -> { tc.assertEquals(list3.getList().size(), 1); async.complete();