Example usage for io.vertx.core VertxOptions DEFAULT_EVENT_LOOP_POOL_SIZE

List of usage examples for io.vertx.core VertxOptions DEFAULT_EVENT_LOOP_POOL_SIZE

Introduction

In this page you can find the example usage for io.vertx.core VertxOptions DEFAULT_EVENT_LOOP_POOL_SIZE.

Prototype

int DEFAULT_EVENT_LOOP_POOL_SIZE

To view the source code for io.vertx.core VertxOptions DEFAULT_EVENT_LOOP_POOL_SIZE.

Click Source Link

Document

The default number of event loop threads to be used = 2 * number of cores on the machine

Usage

From source file:io.gravitee.am.gateway.vertx.VertxEmbeddedContainer.java

License:Apache License

@Override
protected void doStart() {
    instances = (instances < 1) ? VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE : instances;
    logger.info("Starting Vertx container and deploy Gateway Verticles [{} instance(s)]", instances);

    DeploymentOptions options = new DeploymentOptions().setInstances(instances);

    Single<String> deployment = vertx.rxDeployVerticle(
            GraviteeVerticleFactory.GRAVITEE_VERTICLE_PREFIX + ':' + GraviteeVerticle.class.getName(), options);

    deployment.subscribe(id -> {/*from w  w w.j  av a2s  . co  m*/
        // Deployed
        deploymentId = id;
    }, err -> {
        // Could not deploy
        logger.error("Unable to start HTTP server", err.getCause());

        // HTTP Server is a required component. Shutdown if not available
        Runtime.getRuntime().exit(1);
    });
}

From source file:io.gravitee.gateway.standalone.vertx.VertxEmbeddedContainer.java

License:Apache License

@Override
protected void doStart() throws Exception {
    instances = (instances < 1) ? VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE : instances;
    logger.info("Starting Vertx container and deploy Gateway Verticles [{} instance(s)]", instances);

    DeploymentOptions options = new DeploymentOptions().setInstances(instances);
    vertx.deployVerticle(/*  ww  w.  j a  va  2 s .co  m*/
            GraviteeVerticleFactory.GRAVITEE_VERTICLE_PREFIX + ':' + GraviteeVerticle.class.getName(), options,
            event -> {
                deploymentId = event.result();
            });
}