WorkerExecutor we = vertx.createSharedWorkerExecutor("worker1");
we.executeBlocking(blockingCodeHandler, ordered, resultHandler);
public <T> Single<T> executeBlocking(Observable<T> blockingObservable, boolean ordered) {
return currentContext().rxExecuteBlocking(f -> {
blockingObservable.subscribeOn(RxHelper.blockingScheduler(vertx)).subscribe(f::complete, f::fail);
}, ordered);
}
protected <T> Single<T> executeBlocking(Observable<T> blockingObservable, boolean ordered) {
return currentContext().rxExecuteBlocking(f -> {
WorkerExecutor we = vertx.createSharedWorkerExecutor("worker1");
ContextScheduler scheduler = new ContextScheduler(we, ordered);
blockingObservable.subscribeOn(scheduler).subscribe(
next -> {
we.close();
f.complete(next);
}, f::fail);
}, ordered);
}
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/eb27ca81-2584-41b8-b5fa-bcdc4b97b6cb%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/a6ff6700-7e98-4c20-b7e2-7a9f32e207f4%40googlegroups.com.
protected <T> Single<T> executeBlocking(Single<T> blocking, boolean ordered) {
io.vertx.rxjava.core.WorkerExecutor we = new io.vertx.rxjava.core.Vertx(vertx).createSharedWorkerExecutor("worker1");
return we.rxExecuteBlocking(f -> blocking.subscribe(
next -> {
we.close();
f.complete(next);
},
f::
fail
), ordered);
}
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/4fe94ccf-ffa4-4aff-ace1-321b7d08bcc6%40googlegroups.com.