Example usage for io.netty.channel.pool SimpleChannelPool SimpleChannelPool

List of usage examples for io.netty.channel.pool SimpleChannelPool SimpleChannelPool

Introduction

In this page you can find the example usage for io.netty.channel.pool SimpleChannelPool SimpleChannelPool.

Prototype

public SimpleChannelPool(Bootstrap bootstrap, final ChannelPoolHandler handler,
        ChannelHealthChecker healthCheck) 

Source Link

Document

Creates a new instance.

Usage

From source file:com.eucalyptus.util.async.AsyncRequestChannelPoolMap.java

License:Open Source License

@Override
protected SimpleChannelPool newPool(final ChannelPoolKey key) {
    final Bootstrap bootstrap = key.bootstrap.remoteAddress(key.address);
    final ChannelPoolHandler handler = new AsyncRequestsChannelPoolHandler(key.initializer);
    final ChannelHealthChecker checker = new AsyncRequestsChannelHealthChecker();
    if (key.size <= 0) {
        return new SimpleChannelPool(bootstrap, handler, checker);
    } else {/*w w w  .  j  a v a 2s  .c  om*/
        return new FixedChannelPool(bootstrap, handler, checker, FixedChannelPool.AcquireTimeoutAction.FAIL,
                MoreObjects.firstNonNull(StackConfiguration.CLIENT_HTTP_POOL_ACQUIRE_TIMEOUT, 60_000L),
                key.size, Integer.MAX_VALUE);
    }
}