public NettyAsyncHttpProvider(AsyncHttpClientConfig config) {

    this.config = config;
    NettyAsyncHttpProviderConfig nettyConfig =
        config.getAsyncHttpProviderConfig() instanceof NettyAsyncHttpProviderConfig
            ? //
            (NettyAsyncHttpProviderConfig) config.getAsyncHttpProviderConfig()
            : new NettyAsyncHttpProviderConfig();

    allowStopNettyTimer = nettyConfig.getNettyTimer() == null;
    nettyTimer = allowStopNettyTimer ? newNettyTimer() : nettyConfig.getNettyTimer();

    channelManager = new ChannelManager(config, nettyConfig, nettyTimer);
    requestSender = new NettyRequestSender(config, channelManager, nettyTimer, closed);
    channelManager.configureBootstraps(requestSender, closed);
  }