use of reactor.ipc.netty.resources.LoopResources in project reactor-netty by reactor.
the class ServerOptions method groupAndChannel.
final void groupAndChannel(ServerBootstrap bootstrap) {
LoopResources loops = Objects.requireNonNull(getLoopResources(), "loopResources");
boolean useNative = preferNative() && !(sslContext() instanceof JdkSslContext);
final EventLoopGroup selectorGroup = loops.onServerSelect(useNative);
final EventLoopGroup elg = loops.onServer(useNative);
bootstrap.group(selectorGroup, elg).channel(loops.onServerChannel(elg));
}
use of reactor.ipc.netty.resources.LoopResources in project cf-java-client by cloudfoundry.
the class _DefaultConnectionContext method getHttpClient.
@Override
@Value.Default
public HttpClient getHttpClient() {
return HttpClient.create(options -> {
options.compression(true).loopResources(getThreadPool()).option(SO_SNDBUF, SEND_BUFFER_SIZE).option(SO_RCVBUF, RECEIVE_BUFFER_SIZE).disablePool();
options.sslSupport(ssl -> getSslCertificateTruster().ifPresent(trustManager -> ssl.trustManager(new StaticTrustManagerFactory(trustManager))));
getConnectionPool().ifPresent(options::poolResources);
getConnectTimeout().ifPresent(socketTimeout -> options.option(CONNECT_TIMEOUT_MILLIS, (int) socketTimeout.toMillis()));
getKeepAlive().ifPresent(keepAlive -> options.option(SO_KEEPALIVE, keepAlive));
getSslHandshakeTimeout().ifPresent(options::sslHandshakeTimeout);
getSslCloseNotifyFlushTimeout().ifPresent(options::sslCloseNotifyFlushTimeout);
getSslCloseNotifyReadTimeout().ifPresent(options::sslCloseNotifyReadTimeout);
getProxyConfiguration().ifPresent(c -> c.configure(options));
});
}
Aggregations