Examples of ThrottleRequestFilter


Examples of com.ning.http.client.extra.ThrottleRequestFilter

    } else {
      this.repair = null;
    }

    AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
        .addRequestFilter(new ThrottleRequestFilter(MAX_CONNECTIONS))
        .setConnectionTimeoutInMs(CONNECTION_TIMEOUT)
        .setIdleConnectionInPoolTimeoutInMs(IDLE_CONNECTION_TIMEOUT)
        .setRequestTimeoutInMs(REQUEST_TIMEOUT).setMaxRequestRetry(0).build();
    this.asyncHttpClient = new AsyncHttpClient(config);
  }
View Full Code Here

Examples of com.ning.http.client.extra.ThrottleRequestFilter

    } else {
      this.repair = null;
    }

    AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
        .addRequestFilter(new ThrottleRequestFilter(MAX_CONNECTIONS))
        .setConnectionTimeoutInMs(CONNECTION_TIMEOUT)
        .setIdleConnectionInPoolTimeoutInMs(IDLE_CONNECTION_TIMEOUT)
        .setRequestTimeoutInMs(REQUEST_TIMEOUT).setMaxRequestRetry(0).build();
    this.asyncHttpClient = new AsyncHttpClient(config);
  }
View Full Code Here

Examples of com.ning.http.client.extra.ThrottleRequestFilter

    } else {
      this.repair = null;
    }

    AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
        .addRequestFilter(new ThrottleRequestFilter(MAX_CONNECTIONS))
        .setConnectionTimeoutInMs(CONNECTION_TIMEOUT)
        .setIdleConnectionInPoolTimeoutInMs(IDLE_CONNECTION_TIMEOUT)
        .setRequestTimeoutInMs(REQUEST_TIMEOUT).setMaxRequestRetry(0).build();
    this.asyncHttpClient = new AsyncHttpClient(config);
  }
View Full Code Here

Examples of org.asynchttpclient.extra.ThrottleRequestFilter

    }

    @Test(groups = { "standalone", "default_provider" })
    public void basicTest() throws Exception {
        AsyncHttpClientConfig.Builder b = new AsyncHttpClientConfig.Builder();
        b.addRequestFilter(new ThrottleRequestFilter(100));

        AsyncHttpClient c = getAsyncHttpClient(b.build());
        try {
            Response response = c.preparePost(getTargetUrl()).execute().get();
            assertNotNull(response);
View Full Code Here

Examples of org.asynchttpclient.extra.ThrottleRequestFilter

    }

    @Test(groups = { "standalone", "default_provider" })
    public void loadThrottleTest() throws Exception {
        AsyncHttpClientConfig.Builder b = new AsyncHttpClientConfig.Builder();
        b.addRequestFilter(new ThrottleRequestFilter(10));

        AsyncHttpClient c = getAsyncHttpClient(b.build());
        try {
            List<Future<Response>> futures = new ArrayList<Future<Response>>();
            for (int i = 0; i < 200; i++) {
View Full Code Here

Examples of org.asynchttpclient.extra.ThrottleRequestFilter

    }

    @Test(groups = { "standalone", "default_provider" })
    public void maxConnectionsText() throws Exception {
        AsyncHttpClientConfig.Builder b = new AsyncHttpClientConfig.Builder();
        b.addRequestFilter(new ThrottleRequestFilter(0, 1000));
        AsyncHttpClient c = getAsyncHttpClient(b.build());

        try {
            c.preparePost(getTargetUrl()).execute().get();
            fail("Should have timed out");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.