Class FutureRequestExecutionService

java.lang.Object
org.apache.http.impl.client.FutureRequestExecutionService
All Implemented Interfaces:
Closeable, AutoCloseable

@Contract(threading=SAFE) public class FutureRequestExecutionService extends Object implements Closeable
HttpAsyncClientWithFuture wraps calls to execute with a HttpRequestFutureTask and schedules them using the provided executor service. Scheduled calls may be cancelled.
  • Constructor Details

    • FutureRequestExecutionService

      public FutureRequestExecutionService(HttpClient httpclient, ExecutorService executorService)
      Create a new FutureRequestExecutionService.
      Parameters:
      httpclient - you should tune your httpclient instance to match your needs. You should align the max number of connections in the pool and the number of threads in the executor; it doesn't make sense to have more threads than connections and if you have less connections than threads, the threads will just end up blocking on getting a connection from the pool.
      executorService - any executorService will do here. E.g. Executors.newFixedThreadPool(int)
  • Method Details