Package com.mashape.unirest.http.async.utils

Examples of com.mashape.unirest.http.async.utils.AsyncIdleConnectionMonitorThread


      throw new RuntimeException(e);
    }
   
    CloseableHttpAsyncClient asyncClient = HttpAsyncClientBuilder.create().setDefaultRequestConfig(clientConfig).setConnectionManager(asyncConnectionManager).build();
    setOption(Option.ASYNCHTTPCLIENT, asyncClient);
    setOption(Option.ASYNC_MONITOR, new AsyncIdleConnectionMonitorThread(asyncConnectionManager));
  }
View Full Code Here


    HttpUriRequest requestObj = prepareRequest(request, true);

    CloseableHttpAsyncClient asyncHttpClient = ClientFactory.getAsyncHttpClient();
    if (!asyncHttpClient.isRunning()) {
      asyncHttpClient.start();
      AsyncIdleConnectionMonitorThread asyncIdleConnectionMonitorThread = (AsyncIdleConnectionMonitorThread) Options.getOption(Option.ASYNC_MONITOR);
      asyncIdleConnectionMonitorThread.start();
    }

    final Future<org.apache.http.HttpResponse> future = asyncHttpClient.execute(requestObj,
        prepareCallback(responseClass, callback));
View Full Code Here

    CloseableHttpAsyncClient asyncClient = (CloseableHttpAsyncClient) Options.getOption(Option.ASYNCHTTPCLIENT);
    if (asyncClient != null && asyncClient.isRunning()) {
      asyncClient.close();
    }
   
    AsyncIdleConnectionMonitorThread asyncMonitorThread = (AsyncIdleConnectionMonitorThread) Options.getOption(Option.ASYNC_MONITOR);
    if (asyncMonitorThread != null) {
      asyncMonitorThread.interrupt();
    }
  }
View Full Code Here

TOP

Related Classes of com.mashape.unirest.http.async.utils.AsyncIdleConnectionMonitorThread

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.