当前位置: 首页>>代码示例>>Java>>正文


Java AsyncHttpProviderConfig类代码示例

本文整理汇总了Java中com.ning.http.client.AsyncHttpProviderConfig的典型用法代码示例。如果您正苦于以下问题:Java AsyncHttpProviderConfig类的具体用法?Java AsyncHttpProviderConfig怎么用?Java AsyncHttpProviderConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AsyncHttpProviderConfig类属于com.ning.http.client包,在下文中一共展示了AsyncHttpProviderConfig类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createClientConfig

import com.ning.http.client.AsyncHttpProviderConfig; //导入依赖的package包/类
public static AsyncHttpClientConfig.Builder createClientConfig(Configuration configuration) {
    AsyncHttpProviderConfig providerConfig =  new NettyAsyncHttpProviderConfig();
    // We use nio, instead of having a thread per backend ES server node.
    // providerConfig.addProperty(NettyAsyncHttpProviderConfig.USE_BLOCKING_IO,true);
    providerConfig.addProperty(NettyAsyncHttpProviderConfig.EXECUTE_ASYNC_CONNECT,false);

    AsyncHttpClientConfig.Builder cf = new AsyncHttpClientConfig.Builder();

    cf.setAsyncHttpClientProviderConfig(providerConfig);
    cf.setIOThreadMultiplier(1);
    cf.setCompressionEnabled(configuration.getElasticSearchHttpCompressionEnabled());
    cf.setConnectionTimeoutInMs(configuration.getElasticSearchHttpConnectionTimeoutMs());
    cf.setFollowRedirects(configuration.getElasticSearchHttpFollowRedirects());
    cf.setMaximumConnectionsPerHost(1);
    cf.setMaxRequestRetry(configuration.getElasticSearchHttpNoOfRetries());
    cf.setAllowPoolingConnection(configuration.getElasticSearchHttpConnectionPoolingEnabled());
    cf.setRequestTimeoutInMs(configuration.getElasticSearchHttpRequestTimeoutMs());

    return cf;
}
 
开发者ID:tootedom,项目名称:related,代码行数:21,代码来源:AHCFactory.java

示例2: SimpleAsyncHttpProvider

import com.ning.http.client.AsyncHttpProviderConfig; //导入依赖的package包/类
public SimpleAsyncHttpProvider(AsyncHttpClientConfig config) {

        this.config = config;
        AsyncHttpProviderConfig<?, ?> providerConfig = config.getAsyncHttpProviderConfig();
        if (providerConfig instanceof JDKAsyncHttpProviderConfig) {
            configure(JDKAsyncHttpProviderConfig.class.cast(providerConfig));
        }
    }
 
开发者ID:yongbeam,项目名称:Android-kakaologin-gradle-sample,代码行数:9,代码来源:SimpleAsyncHttpProvider.java

示例3: getAsyncHttpProviderConfig

import com.ning.http.client.AsyncHttpProviderConfig; //导入依赖的package包/类
@Override
public AsyncHttpProviderConfig<?, ?> getAsyncHttpProviderConfig() {
  return config.getAsyncHttpProviderConfig();
}
 
开发者ID:MachinePublishers,项目名称:ScreenSlicer,代码行数:5,代码来源:LenientHttpsConfig.java


注:本文中的com.ning.http.client.AsyncHttpProviderConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。