Search in sources :

Example 1 with ConnectionManager

use of io.vertx.core.net.impl.pool.ConnectionManager in project vert.x by eclipse.

the class HttpClientImpl method httpConnectionManager.

private ConnectionManager<EndpointKey, Lease<HttpClientConnection>> httpConnectionManager() {
    int maxPoolSize = Math.max(options.getMaxPoolSize(), options.getHttp2MaxPoolSize());
    return new ConnectionManager<>((key, ctx, dispose) -> {
        ClientMetrics metrics = this.metrics != null ? this.metrics.createEndpointMetrics(key.serverAddr, maxPoolSize) : null;
        HttpChannelConnector connector = new HttpChannelConnector(this, netClient, key.proxyOptions, metrics, options.getProtocolVersion(), key.ssl, options.isUseAlpn(), key.peerAddr, key.serverAddr);
        return new SharedClientHttpStreamEndpoint(this, metrics, options.getMaxWaitQueueSize(), options.getMaxPoolSize(), options.getHttp2MaxPoolSize(), connector, dispose);
    });
}
Also used : ConnectionManager(io.vertx.core.net.impl.pool.ConnectionManager) HttpClientMetrics(io.vertx.core.spi.metrics.HttpClientMetrics) ClientMetrics(io.vertx.core.spi.metrics.ClientMetrics) Endpoint(io.vertx.core.net.impl.pool.Endpoint)

Example 2 with ConnectionManager

use of io.vertx.core.net.impl.pool.ConnectionManager in project vert.x by eclipse.

the class HttpClientImpl method webSocketConnectionManager.

private ConnectionManager<EndpointKey, HttpClientConnection> webSocketConnectionManager() {
    int maxPoolSize = options.getMaxWebSockets();
    return new ConnectionManager<>((key, ctx, dispose) -> {
        ClientMetrics metrics = this.metrics != null ? this.metrics.createEndpointMetrics(key.serverAddr, maxPoolSize) : null;
        HttpChannelConnector connector = new HttpChannelConnector(this, netClient, key.proxyOptions, metrics, HttpVersion.HTTP_1_1, key.ssl, false, key.peerAddr, key.serverAddr);
        return new WebSocketEndpoint(null, maxPoolSize, connector, dispose);
    });
}
Also used : ConnectionManager(io.vertx.core.net.impl.pool.ConnectionManager) HttpClientMetrics(io.vertx.core.spi.metrics.HttpClientMetrics) ClientMetrics(io.vertx.core.spi.metrics.ClientMetrics) Endpoint(io.vertx.core.net.impl.pool.Endpoint)

Aggregations

ConnectionManager (io.vertx.core.net.impl.pool.ConnectionManager)2 Endpoint (io.vertx.core.net.impl.pool.Endpoint)2 ClientMetrics (io.vertx.core.spi.metrics.ClientMetrics)2 HttpClientMetrics (io.vertx.core.spi.metrics.HttpClientMetrics)2