/** * Like {@link io.vertx.rxjava.core.Vertx#executeBlocking} called with ordered = true. * @param blockingCodeHandler * @return * @deprecated use {@link #rxExecuteBlocking} instead */ @Deprecated() public <T> Observable<T> executeBlockingObservable(Handler<io.vertx.rxjava.core.Future<T>> blockingCodeHandler) { io.vertx.rx.java.ObservableFuture<T> resultHandler = io.vertx.rx.java.RxHelper.observableFuture(); executeBlocking(blockingCodeHandler, resultHandler.toHandler()); return resultHandler; }
/** * Like {@link io.vertx.rxjava.core.Vertx#executeBlocking} called with ordered = true. * @param blockingCodeHandler * @return */ public <T> Single<T> rxExecuteBlocking(Handler<io.vertx.rxjava.core.Future<T>> blockingCodeHandler) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { executeBlocking(blockingCodeHandler, fut); })); }
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(); }); }
/** * Like {@link io.vertx.rxjava.core.Vertx#executeBlocking} called with ordered = true. * @param blockingCodeHandler * @return */ public <T> Single<T> rxExecuteBlocking(Handler<io.vertx.rxjava.core.Future<T>> blockingCodeHandler) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { executeBlocking(blockingCodeHandler, fut); })); }
public <T> Observable<T> executeBlockingObservable(Handler<io.vertx.rxjava.core.Future<T>> blockingCodeHandler, boolean ordered) { io.vertx.rx.java.ObservableFuture<T> resultHandler = io.vertx.rx.java.RxHelper.observableFuture(); executeBlocking(blockingCodeHandler, ordered, resultHandler.toHandler()); return resultHandler;
executeBlocking(blockingCodeHandler, ordered, fut); }));
executeBlocking(blockingCodeHandler, ordered, fut); }));
vertx.executeBlocking(f -> { File archiveFile = new File(archivePath); File destFile = new File(destPath);