Package com.mashape.unirest.http.utils

Examples of com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread


    syncConnectionManager.setMaxTotal(Integer.MAX_VALUE);
    syncConnectionManager.setDefaultMaxPerRoute(Integer.MAX_VALUE);
   
    // Create clients
    setOption(Option.HTTPCLIENT, HttpClientBuilder.create().setDefaultRequestConfig(clientConfig).setConnectionManager(syncConnectionManager).build());
    SyncIdleConnectionMonitorThread syncIdleConnectionMonitorThread = new SyncIdleConnectionMonitorThread(syncConnectionManager);
    setOption(Option.SYNC_MONITOR, syncIdleConnectionMonitorThread);
    syncIdleConnectionMonitorThread.start();
   
    DefaultConnectingIOReactor ioreactor;
    PoolingNHttpClientConnectionManager asyncConnectionManager;
    try {
      ioreactor = new DefaultConnectingIOReactor();
View Full Code Here


    CloseableHttpClient syncClient = (CloseableHttpClient) Options.getOption(Option.HTTPCLIENT);
    if (syncClient != null) {
      syncClient.close();
    }
   
    SyncIdleConnectionMonitorThread syncIdleConnectionMonitorThread = (SyncIdleConnectionMonitorThread) Options.getOption(Option.SYNC_MONITOR);
    if (syncIdleConnectionMonitorThread != null) {
      syncIdleConnectionMonitorThread.interrupt();
    }
   
    // Closing the Async HTTP client (if running)
    CloseableHttpAsyncClient asyncClient = (CloseableHttpAsyncClient) Options.getOption(Option.ASYNCHTTPCLIENT);
    if (asyncClient != null && asyncClient.isRunning()) {
View Full Code Here

TOP

Related Classes of com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread

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.