@Contract(threading=STATELESS) public abstract class CloseableHttpAsyncClient extends Object implements HttpAsyncClient, org.apache.hc.core5.io.ModalCloseable
HttpAsyncClient
that also implements ModalCloseable
.Constructor and Description |
---|
CloseableHttpAsyncClient() |
Modifier and Type | Method and Description |
---|---|
abstract void |
awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) |
protected abstract <T> Future<T> |
doExecute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<T> callback) |
<T> Future<T> |
execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
org.apache.hc.core5.concurrent.FutureCallback<T> callback) |
<T> Future<T> |
execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<T> callback)
Initiates asynchronous HTTP request execution using the given context.
|
<T> Future<T> |
execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<T> callback) |
<T> Future<T> |
execute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<T> callback) |
Future<SimpleHttpResponse> |
execute(SimpleHttpRequest request,
org.apache.hc.core5.concurrent.FutureCallback<SimpleHttpResponse> callback) |
Future<SimpleHttpResponse> |
execute(SimpleHttpRequest request,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<SimpleHttpResponse> callback) |
abstract org.apache.hc.core5.reactor.IOReactorStatus |
getStatus() |
abstract void |
initiateShutdown() |
abstract void |
register(String hostname,
String uriPattern,
org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
Deprecated.
Use
RequestRouter
at the construction time |
void |
register(String uriPattern,
org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
Deprecated.
Use
RequestRouter
at the construction time |
abstract void |
start() |
public abstract void start()
public abstract org.apache.hc.core5.reactor.IOReactorStatus getStatus()
public abstract void awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) throws InterruptedException
InterruptedException
public abstract void initiateShutdown()
protected abstract <T> Future<T> doExecute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
public final <T> Future<T> execute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
public final <T> Future<T> execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
HttpAsyncClient
The request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.
Please note it may be unsafe to interact with the context instance while the request is still being executed.
execute
in interface HttpAsyncClient
T
- the result type of request execution.requestProducer
- request producer callback.responseConsumer
- response consumer callback.pushHandlerFactory
- the push handler factory. Optional and may be null
.context
- HTTP context. Optional and may be null
.callback
- future callback. Optional and may be null
.public final <T> Future<T> execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
public final <T> Future<T> execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
public final Future<SimpleHttpResponse> execute(SimpleHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<SimpleHttpResponse> callback)
public final Future<SimpleHttpResponse> execute(SimpleHttpRequest request, org.apache.hc.core5.concurrent.FutureCallback<SimpleHttpResponse> callback)
@Deprecated public abstract void register(String hostname, String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
RequestRouter
at the construction time@Deprecated public final void register(String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
RequestRouter
at the construction timeCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.