@Contract(threading=STATELESS) public abstract class CloseableHttpAsyncClient extends Object implements HttpAsyncClient, ModalCloseable
HttpAsyncClient that also implements ModalCloseable.| 构造器和说明 |
|---|
CloseableHttpAsyncClient() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic abstract void start()
public abstract IOReactorStatus getStatus()
public abstract void awaitShutdown(TimeValue waitTime) throws InterruptedException
public abstract void initiateShutdown()
protected abstract <T> Future<T> doExecute(HttpHost target, AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context, FutureCallback<T> callback)
public final <T> Future<T> execute(HttpHost target, AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context, FutureCallback<T> callback)
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context, FutureCallback<T> callback)
HttpAsyncClientThe 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 在接口中 HttpAsyncClientT - 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(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HttpContext context, FutureCallback<T> callback)
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, FutureCallback<T> callback)
public final Future<SimpleHttpResponse> execute(SimpleHttpRequest request, HttpContext context, FutureCallback<SimpleHttpResponse> callback)
public final Future<SimpleHttpResponse> execute(SimpleHttpRequest request, FutureCallback<SimpleHttpResponse> callback)
public abstract void register(String hostname, String uriPattern, Supplier<AsyncPushConsumer> supplier)
public final void register(String uriPattern, Supplier<AsyncPushConsumer> supplier)
Copyright © 2023. All rights reserved.