Class DefaultAsyncOverReactiveHttpClient
java.lang.Object
io.micronaut.http.client.DefaultAsyncOverReactiveHttpClient
- All Implemented Interfaces:
LifeCycle<AsyncHttpClient>, AsyncHttpClient, Closeable, AutoCloseable
Default
AsyncHttpClient implementation that adapts a reactive HttpClient.- Since:
- 5.0
- Author:
- Denis Stepanov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Delegates toLifeCycle.stop().<I,O, E> CompletionStage <HttpResponse<O>> exchange(HttpRequest<I> request, @Nullable Argument<O> bodyType, Argument<E> errorType) Perform an HTTP request for the given request object emitting the full HTTP response and converting the response body to the specified type.protected final HttpClientbooleanstart()Starts the lifecyle component.stop()Stops the life cycle component.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DefaultAsyncOverReactiveHttpClient
- Parameters:
httpClient- The delegate client
-
-
Method Details
-
exchange
public <I,O, CompletionStage<HttpResponse<O>> exchangeE> (HttpRequest<I> request, @Nullable Argument<O> bodyType, Argument<E> errorType) Description copied from interface:AsyncHttpClientPerform an HTTP request for the given request object emitting the full HTTP response and converting the response body to the specified type.- Specified by:
exchangein interfaceAsyncHttpClient- Type Parameters:
I- The request body typeO- The response body typeE- The error type- Parameters:
request- TheHttpRequestto executebodyType- The body typeerrorType- The error type- Returns:
- A
CompletionStagethat completes with the fullHttpResponse
-
start
Description copied from interface:LifeCycleStarts the lifecyle component.- Specified by:
startin interfaceLifeCycle<AsyncHttpClient>- Returns:
- This lifecycle component
-
stop
Description copied from interface:LifeCycleStops the life cycle component.- Specified by:
stopin interfaceLifeCycle<AsyncHttpClient>- Returns:
- This lifecycle component
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceLifeCycle<AsyncHttpClient>- Returns:
- Whether the component is running
-
close
public void close()Description copied from interface:LifeCycleDelegates toLifeCycle.stop().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceLifeCycle<AsyncHttpClient>
-
getHttpClient
- Returns:
- The underlying
HttpClient
-