@Experimental public interface AsyncClient<C>
requests
asynchronously, with an optional context.Modifier and Type | Interface and Description |
---|---|
static class |
AsyncClient.Default<C> |
static class |
AsyncClient.Pseudo<C>
A synchronous implementation of
AsyncClient |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Response> |
execute(Request request,
Request.Options options,
Optional<C> requestContext)
Executes the request asynchronously.
|
CompletableFuture<Response> execute(Request request, Request.Options options, Optional<C> requestContext)
CompletableFuture.cancel(boolean)
on the
result may cause the execution to be cancelled / aborted, but this is not guaranteed.request
- safe to replayoptions
- options to apply to this requestrequestContext
- - the optional context, for example for storing session cookies. The
client should update this appropriately based on the received response before completing
the result.CompletableFuture
to be completed with the response, or completed
exceptionally otherwise, for example with an IOException
on a network
error connecting to Request.url()
.Copyright © 2012–2021 OpenFeign. All rights reserved.