List of usage examples for io.vertx.core Vertx createSharedWorkerExecutor
WorkerExecutor createSharedWorkerExecutor(String name);
From source file:examples.CoreExamples.java
License:Open Source License
public void workerExecutor1(Vertx vertx) { WorkerExecutor executor = vertx.createSharedWorkerExecutor("my-worker-pool"); executor.executeBlocking(future -> { // Call some blocking API that takes a significant amount of time to return String result = someAPI.blockingMethod("hello"); future.complete(result);// w ww . ja v a 2 s.c o m }, res -> { System.out.println("The result is: " + res.result()); }); }