Search in sources :

Example 1 with ClientHttp1IOEventHandlerFactory

use of org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandlerFactory in project httpcomponents-core by apache.

the class AsyncRequesterBootstrap method create.

public HttpAsyncRequester create() {
    final ManagedConnPool<HttpHost, IOSession> connPool;
    switch(poolConcurrencyPolicy != null ? poolConcurrencyPolicy : PoolConcurrencyPolicy.STRICT) {
        case LAX:
            connPool = new LaxConnPool<>(defaultMaxPerRoute > 0 ? defaultMaxPerRoute : 20, timeToLive, poolReusePolicy, new DefaultDisposalCallback<>(), connPoolListener);
            break;
        case STRICT:
        default:
            connPool = new StrictConnPool<>(defaultMaxPerRoute > 0 ? defaultMaxPerRoute : 20, maxTotal > 0 ? maxTotal : 50, timeToLive, poolReusePolicy, new DefaultDisposalCallback<>(), connPoolListener);
            break;
    }
    final ClientHttp1StreamDuplexerFactory streamDuplexerFactory = new ClientHttp1StreamDuplexerFactory(httpProcessor != null ? httpProcessor : HttpProcessors.client(), http1Config != null ? http1Config : Http1Config.DEFAULT, charCodingConfig != null ? charCodingConfig : CharCodingConfig.DEFAULT, connStrategy, null, null, streamListener);
    final IOEventHandlerFactory ioEventHandlerFactory = new ClientHttp1IOEventHandlerFactory(streamDuplexerFactory, tlsStrategy != null ? tlsStrategy : new BasicClientTlsStrategy(), handshakeTimeout);
    return new HttpAsyncRequester(ioReactorConfig, ioEventHandlerFactory, ioSessionDecorator, exceptionCallback, sessionListener, connPool);
}
Also used : DefaultDisposalCallback(org.apache.hc.core5.pool.DefaultDisposalCallback) BasicClientTlsStrategy(org.apache.hc.core5.http.nio.ssl.BasicClientTlsStrategy) ClientHttp1StreamDuplexerFactory(org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexerFactory) HttpHost(org.apache.hc.core5.http.HttpHost) IOSession(org.apache.hc.core5.reactor.IOSession) ClientHttp1IOEventHandlerFactory(org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandlerFactory) IOEventHandlerFactory(org.apache.hc.core5.reactor.IOEventHandlerFactory) ClientHttp1IOEventHandlerFactory(org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandlerFactory)

Aggregations

HttpHost (org.apache.hc.core5.http.HttpHost)1 ClientHttp1IOEventHandlerFactory (org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandlerFactory)1 ClientHttp1StreamDuplexerFactory (org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexerFactory)1 BasicClientTlsStrategy (org.apache.hc.core5.http.nio.ssl.BasicClientTlsStrategy)1 DefaultDisposalCallback (org.apache.hc.core5.pool.DefaultDisposalCallback)1 IOEventHandlerFactory (org.apache.hc.core5.reactor.IOEventHandlerFactory)1 IOSession (org.apache.hc.core5.reactor.IOSession)1