Example usage for io.vertx.core Vertx createSharedWorkerExecutor

List of usage examples for io.vertx.core Vertx createSharedWorkerExecutor

Introduction

In this page you can find the example usage for io.vertx.core Vertx createSharedWorkerExecutor.

Prototype

WorkerExecutor createSharedWorkerExecutor(String name);

Source Link

Document

Like #createSharedWorkerExecutor(String,int) but with the VertxOptions#setWorkerPoolSize poolSize .

Usage

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());
    });
}