Package com.cloudhopper.commons.util

Examples of com.cloudhopper.commons.util.NamingThreadFactory


        // Set the maximum time in millisecond an AsyncHttpClient can stay idle:
  //   AsyncHttpClientConfig.Builder setIdleConnectionTimeoutInMs(int defaultIdleConnectionTimeoutInMs)

  // Override the Ning Async Client's reaper behavior
        ScheduledExecutorService reaper = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(),
                     new NamingThreadFactory("CHMQ-HttpClient-Reaper", true));
  httpConfigBuilder.setScheduledExecutorService(reaper);
 
  // Override the Ning Async Client's worker thread pool behavior
        ExecutorService applicationThreadPool = Executors.newFixedThreadPool((Runtime.getRuntime().availableProcessors() * 2)+1,
                       new NamingThreadFactory("CHMQ-HttpClient-Callback", true));
  httpConfigBuilder.setExecutorService(applicationThreadPool);
  httpConfigBuilder.setIOThreadMultiplier(2); //This is the default

  http = new AsyncHttpClient(httpConfigBuilder.build());
View Full Code Here

TOP

Related Classes of com.cloudhopper.commons.util.NamingThreadFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.