Example usage for org.apache.http.nio.client HttpAsyncClient execute

List of usage examples for org.apache.http.nio.client HttpAsyncClient execute

Introduction

In this page you can find the example usage for org.apache.http.nio.client HttpAsyncClient execute.

Prototype

Future<HttpResponse> execute(HttpUriRequest request, HttpContext context,
        FutureCallback<HttpResponse> callback);

Source Link

Document

Initiates asynchronous HTTP request execution using the given context.

Usage

From source file:org.jenkinsci.plugins.relution_publisher.net.requests.ZeroCopyFileRequest.java

@Override
public Future<HttpResponse> execute(final HttpAsyncClient httpClient) throws FileNotFoundException {

    final HttpAsyncResponseConsumer<HttpResponse> consumer = new BasicAsyncResponseConsumer();
    final HttpAsyncRequestProducer producer = new ZeroCopyFileRequestProducer(this);

    return httpClient.execute(producer, consumer, null);
}