Examples of MaxConnectionsBasedStrategy


Examples of io.reactivex.netty.client.MaxConnectionsBasedStrategy

    @Test
    public void testConnectionPoolMetrics() throws InterruptedException, ExecutionException, TimeoutException {
        HttpClientBuilder<ByteBuf, ByteBuf> builder = RxContexts.newHttpClientBuilder("www.google.com", 80, RxContexts.DEFAULT_CORRELATOR);
        HttpClient<ByteBuf, ByteBuf> client = builder.withConnectionPoolLimitStrategy(new CompositePoolLimitDeterminationStrategy(
                new MaxConnectionsBasedStrategy(100), new MaxConnectionsBasedStrategy(100))).build();
        HttpClientListener listener = HttpClientListener.newHttpListener("default");
        client.subscribe(listener);
        HttpClientRequest<ByteBuf> request = HttpClientRequest.createGet("/");
        client.submit(request).flatMap(new Func1<HttpClientResponse<ByteBuf>, Observable<ByteBuf>>(){
            @Override
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.