Class DefaultAsyncOverReactiveHttpClient

java.lang.Object
io.micronaut.http.client.DefaultAsyncOverReactiveHttpClient
All Implemented Interfaces:
io.micronaut.context.LifeCycle<AsyncHttpClient>, AsyncHttpClient, Closeable, AutoCloseable

@Internal public class DefaultAsyncOverReactiveHttpClient extends Object implements AsyncHttpClient
Default AsyncHttpClient implementation that adapts a reactive HttpClient.
Since:
5.0
  • Constructor Details

    • DefaultAsyncOverReactiveHttpClient

      public DefaultAsyncOverReactiveHttpClient(HttpClient httpClient)
      Parameters:
      httpClient - The delegate client
  • Method Details

    • exchange

      public <I,O,E> CompletionStage<io.micronaut.http.HttpResponse<O>> exchange(io.micronaut.http.HttpRequest<I> request, @Nullable io.micronaut.core.type.Argument<O> bodyType, io.micronaut.core.type.Argument<E> errorType)
      Description copied from interface: AsyncHttpClient
      Perform an HTTP request for the given request object emitting the full HTTP response and converting the response body to the specified type.
      Specified by:
      exchange in interface AsyncHttpClient
      Type Parameters:
      I - The request body type
      O - The response body type
      E - The error type
      Parameters:
      request - The HttpRequest to execute
      bodyType - The body type
      errorType - The error type
      Returns:
      A CompletionStage that completes with the full HttpResponse
    • start

      Specified by:
      start in interface io.micronaut.context.LifeCycle<AsyncHttpClient>
    • stop

      Specified by:
      stop in interface io.micronaut.context.LifeCycle<AsyncHttpClient>
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface io.micronaut.context.LifeCycle<AsyncHttpClient>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface io.micronaut.context.LifeCycle<AsyncHttpClient>
    • getHttpClient

      protected final HttpClient getHttpClient()
      Returns:
      The underlying HttpClient