Package org.asynchttpclient.extra

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


    }

    @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

    }

    @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

Related Classes of org.asynchttpclient.extra.ThrottleRequestFilter

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.