Example usage for io.vertx.core VertxOptions setPreferNativeTransport

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

Introduction

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

Prototype

public VertxOptions setPreferNativeTransport(boolean preferNativeTransport) 

Source Link

Document

Set wether to prefer the native transport to the JDK transport.

Usage

From source file:io.gravitee.am.gateway.handler.vertx.RxVertxTestBase.java

License:Apache License

protected VertxOptions getOptions() {
    VertxOptions options = new VertxOptions();
    options.setPreferNativeTransport(USE_NATIVE_TRANSPORT);
    return options;
}

From source file:io.reactiverse.pgclient.PgClient.java

License:Apache License

/**
 * Create a connection pool to the database configured with the given {@code options}.
 *
 * @param options the options for creating the pool
 * @return the connection pool/*  w  w w.j ava  2 s .  c o m*/
 */
static PgPool pool(PgPoolOptions options) {
    if (Vertx.currentContext() != null) {
        throw new IllegalStateException(
                "Running in a Vertx context => use PgPool#pool(Vertx, PgPoolOptions) instead");
    }
    VertxOptions vertxOptions = new VertxOptions();
    if (options.isUsingDomainSocket()) {
        vertxOptions.setPreferNativeTransport(true);
    }
    Vertx vertx = Vertx.vertx(vertxOptions);
    return new PgPoolImpl(vertx, true, options);
}