public interface AsyncServerResponse extends ServerResponse
ServerResponse
that exposes the future
response.ServerResponse.async(Object)
ServerResponse.BodyBuilder, ServerResponse.Context, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>, ServerResponse.SseBuilder
Modifier and Type | Method and Description |
---|---|
ServerResponse |
block()
Blocks indefinitely until the future response is obtained.
|
static AsyncServerResponse |
create(Object asyncResponse)
Create a
AsyncServerResponse with the given asynchronous response. |
static AsyncServerResponse |
create(Object asyncResponse,
Duration timeout)
Create a (built) response with the given asynchronous response.
|
accepted, async, async, badRequest, cookies, created, from, headers, noContent, notFound, ok, permanentRedirect, rawStatusCode, seeOther, sse, sse, status, status, statusCode, temporaryRedirect, unprocessableEntity, writeTo
ServerResponse block()
static AsyncServerResponse create(Object asyncResponse)
AsyncServerResponse
with the given asynchronous response.
Parameter asyncResponse
can be a
CompletableFuture<ServerResponse>
or
Publisher<ServerResponse>
(or any
asynchronous producer of a single ServerResponse
that can be
adapted via the ReactiveAdapterRegistry
).asyncResponse
- a CompletableFuture<ServerResponse>
or
Publisher<ServerResponse>
static AsyncServerResponse create(Object asyncResponse, Duration timeout)
asyncResponse
can be a
CompletableFuture<ServerResponse>
or
Publisher<ServerResponse>
(or any
asynchronous producer of a single ServerResponse
that can be
adapted via the ReactiveAdapterRegistry
).asyncResponse
- a CompletableFuture<ServerResponse>
or
Publisher<ServerResponse>
timeout
- maximum time period to wait for before timing out