/** * Get an optional server node, randomly choose. * @return a {@link fr.javacrea.vertx.consul.test.utils.rxjava.ConsulTestNode} in server mode */ public Future<ConsulTestNode> getServerNode() { Future<ConsulTestNode> ret = Future.newInstance(delegate.getServerNode(), fr.javacrea.vertx.consul.test.utils.rxjava.ConsulTestNode.__TYPE_ARG); return ret; }
public static <T>Future<T> newInstance(io.vertx.core.Future arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T) { return arg != null ? new Future<T>(arg, __typeArg_T) : null; } }
/** * Like {@link io.vertx.rxjava.core.CompositeFuture#all} but with 6 futures. * @param f1 * @param f2 * @param f3 * @param f4 * @param f5 * @param f6 * @return */ public static <T1, T2, T3, T4, T5, T6> io.vertx.rxjava.core.CompositeFuture all(io.vertx.rxjava.core.Future<T1> f1, io.vertx.rxjava.core.Future<T2> f2, io.vertx.rxjava.core.Future<T3> f3, io.vertx.rxjava.core.Future<T4> f4, io.vertx.rxjava.core.Future<T5> f5, io.vertx.rxjava.core.Future<T6> f6) { io.vertx.rxjava.core.CompositeFuture ret = io.vertx.rxjava.core.CompositeFuture.newInstance(io.vertx.core.CompositeFuture.all(f1.getDelegate(), f2.getDelegate(), f3.getDelegate(), f4.getDelegate(), f5.getDelegate(), f6.getDelegate())); return ret; }
private void onIncomingDeliveryPackage(IncomingDeliveryEvent event) { requireNonNull(event, "`event` must not be null"); TrafficsoftDeliveryPackage deliveryPackage = event.getDeliveryPackage(); final Stopwatch stopwatch = Stopwatch.createStarted(); vertx.executeBlocking(future -> { consumeIncomingDeliveryEvent(event); future.complete(); }, result -> { if (result.failed()) { log.error("", result.cause()); } if (result.succeeded()) { if (log.isDebugEnabled()) { log.debug("Successfully consumed {} nodes in {}ms", deliveryPackage.getAmountOfNodes(), stopwatch .elapsed(TimeUnit.MILLISECONDS)); } } stopwatch.stop(); }); }
/** * Set a handler for the result. * <p> * If the future has already been completed it will be called immediately. Otherwise it will be called when the * future is completed. * @return a reference to this, so it can be used fluently * @deprecated use {@link #rxSetHandler} instead */ @Deprecated() public Observable<T> setHandlerObservable() { io.vertx.rx.java.ObservableFuture<T> handler = io.vertx.rx.java.RxHelper.observableFuture(); setHandler(handler.toHandler()); return handler; }
/** * Set a handler for the result. * <p> * If the future has already been completed it will be called immediately. Otherwise it will be called when the * future is completed. * @return a reference to this, so it can be used fluently */ public Single<T> rxSetHandler() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { setHandler(fut); })); }
/** * Get an optional client node, randomly choose. * @return a <code>ConsulTestNode</code> in client mode */ public Future<ConsulTestNode> getClientNode() { Future<ConsulTestNode> ret = Future.newInstance(delegate.getClientNode(), fr.javacrea.vertx.consul.test.utils.rxjava.ConsulTestNode.__TYPE_ARG); return ret; }
/** * Like {@link io.vertx.rxjava.core.CompositeFuture#join} but with 5 futures. * @param f1 * @param f2 * @param f3 * @param f4 * @param f5 * @return */ public static <T1, T2, T3, T4, T5> io.vertx.rxjava.core.CompositeFuture join(io.vertx.rxjava.core.Future<T1> f1, io.vertx.rxjava.core.Future<T2> f2, io.vertx.rxjava.core.Future<T3> f3, io.vertx.rxjava.core.Future<T4> f4, io.vertx.rxjava.core.Future<T5> f5) { io.vertx.rxjava.core.CompositeFuture ret = io.vertx.rxjava.core.CompositeFuture.newInstance(io.vertx.core.CompositeFuture.join(f1.getDelegate(), f2.getDelegate(), f3.getDelegate(), f4.getDelegate(), f5.getDelegate())); return ret; }
public static <T>Future<T> newInstance(io.vertx.core.Future arg) { return arg != null ? new Future<T>(arg) : null; }
/** * Set a handler for the result. * <p> * If the future has already been completed it will be called immediately. Otherwise it will be called when the * future is completed. * @return a reference to this, so it can be used fluently */ public Single<T> rxSetHandler() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { setHandler(fut); })); }
/** * Create a succeeded future with a null result * @return the future */ public static <T> io.vertx.rxjava.core.Future<T> succeededFuture() { io.vertx.rxjava.core.Future<T> ret = io.vertx.rxjava.core.Future.newInstance(io.vertx.core.Future.succeededFuture(), io.vertx.lang.rx.TypeArg.unknown()); return ret; }
/** * Like {@link io.vertx.rxjava.core.CompositeFuture#any} but with 5 futures. * @param f1 * @param f2 * @param f3 * @param f4 * @param f5 * @return */ public static <T1, T2, T3, T4, T5> io.vertx.rxjava.core.CompositeFuture any(io.vertx.rxjava.core.Future<T1> f1, io.vertx.rxjava.core.Future<T2> f2, io.vertx.rxjava.core.Future<T3> f3, io.vertx.rxjava.core.Future<T4> f4, io.vertx.rxjava.core.Future<T5> f5) { io.vertx.rxjava.core.CompositeFuture ret = io.vertx.rxjava.core.CompositeFuture.newInstance(io.vertx.core.CompositeFuture.any(f1.getDelegate(), f2.getDelegate(), f3.getDelegate(), f4.getDelegate(), f5.getDelegate())); return ret; }
public static <T>Future<T> newInstance(io.vertx.core.Future arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T) { return arg != null ? new Future<T>(arg, __typeArg_T) : null; } }
/** * Created a succeeded future with the specified result. * @param result the result * @return the future */ public static <T> io.vertx.rxjava.core.Future<T> succeededFuture(T result) { io.vertx.rxjava.core.Future<T> ret = io.vertx.rxjava.core.Future.newInstance(io.vertx.core.Future.succeededFuture(result), io.vertx.lang.rx.TypeArg.unknown()); return ret; }
/** * Like {@link io.vertx.rxjava.core.CompositeFuture#join} but with 6 futures. * @param f1 * @param f2 * @param f3 * @param f4 * @param f5 * @param f6 * @return */ public static <T1, T2, T3, T4, T5, T6> io.vertx.rxjava.core.CompositeFuture join(io.vertx.rxjava.core.Future<T1> f1, io.vertx.rxjava.core.Future<T2> f2, io.vertx.rxjava.core.Future<T3> f3, io.vertx.rxjava.core.Future<T4> f4, io.vertx.rxjava.core.Future<T5> f5, io.vertx.rxjava.core.Future<T6> f6) { io.vertx.rxjava.core.CompositeFuture ret = io.vertx.rxjava.core.CompositeFuture.newInstance(io.vertx.core.CompositeFuture.join(f1.getDelegate(), f2.getDelegate(), f3.getDelegate(), f4.getDelegate(), f5.getDelegate(), f6.getDelegate())); return ret; }
public static <T>Future<T> newInstance(io.vertx.core.Future arg) { return arg != null ? new Future<T>(arg) : null; }
/** * Create a failed future with the specified failure cause. * @param t the failure cause as a Throwable * @return the future */ public static <T> io.vertx.rxjava.core.Future<T> failedFuture(Throwable t) { io.vertx.rxjava.core.Future<T> ret = io.vertx.rxjava.core.Future.newInstance(io.vertx.core.Future.failedFuture(t), io.vertx.lang.rx.TypeArg.unknown()); return ret; }
/** * Like {@link io.vertx.rxjava.core.CompositeFuture#join} but with 6 futures. * @param f1 * @param f2 * @param f3 * @param f4 * @param f5 * @param f6 * @return */ public static <T1, T2, T3, T4, T5, T6> io.vertx.rxjava.core.CompositeFuture join(io.vertx.rxjava.core.Future<T1> f1, io.vertx.rxjava.core.Future<T2> f2, io.vertx.rxjava.core.Future<T3> f3, io.vertx.rxjava.core.Future<T4> f4, io.vertx.rxjava.core.Future<T5> f5, io.vertx.rxjava.core.Future<T6> f6) { io.vertx.rxjava.core.CompositeFuture ret = io.vertx.rxjava.core.CompositeFuture.newInstance(io.vertx.core.CompositeFuture.join(f1.getDelegate(), f2.getDelegate(), f3.getDelegate(), f4.getDelegate(), f5.getDelegate(), f6.getDelegate())); return ret; }