Interface AsyncServerResponse
- All Superinterfaces:
ServerResponse
Asynchronous subtype of
ServerResponse
that exposes the future
response.- Since:
- 5.3.2
- Author:
- Arjen Poutsma
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.web.servlet.function.ServerResponse
ServerResponse.AsyncBuilder<B extends ServerResponse.AsyncBuilder<B>>, ServerResponse.BodyBuilder, ServerResponse.Context, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>, ServerResponse.SseBuilder, ServerResponse.StreamBuilder
-
Method Summary
Modifier and TypeMethodDescriptionblock()
Blocks indefinitely until the future response is obtained.static AsyncServerResponse
Create aAsyncServerResponse
with the given asynchronous response.static AsyncServerResponse
Create a (built) response with the given asynchronous response.Methods inherited from interface org.springframework.web.servlet.function.ServerResponse
cookies, headers, rawStatusCode, statusCode, writeTo
-
Method Details
-
block
ServerResponse block()Blocks indefinitely until the future response is obtained. -
create
Create aAsyncServerResponse
with the given asynchronous response. ParameterasyncResponse
can be aCompletableFuture<ServerResponse>
orPublisher<ServerResponse>
(or any asynchronous producer of a singleServerResponse
that can be adapted via theReactiveAdapterRegistry
).- Parameters:
asyncResponse
- aCompletableFuture<ServerResponse>
orPublisher<ServerResponse>
- Returns:
- the asynchronous response
-
create
Create a (built) response with the given asynchronous response. ParameterasyncResponse
can be aCompletableFuture<ServerResponse>
orPublisher<ServerResponse>
(or any asynchronous producer of a singleServerResponse
that can be adapted via theReactiveAdapterRegistry
).- Parameters:
asyncResponse
- aCompletableFuture<ServerResponse>
orPublisher<ServerResponse>
timeout
- maximum time period to wait for before timing out- Returns:
- the asynchronous response
-