类 DefaultAsyncServerResponse
java.lang.Object
cn.taketoday.web.handler.function.ErrorHandlingServerResponse
cn.taketoday.web.handler.function.DefaultAsyncServerResponse
- 所有已实现的接口:
AsyncServerResponse,ServerResponse
final class DefaultAsyncServerResponse
extends ErrorHandlingServerResponse
implements AsyncServerResponse
Default
AsyncServerResponse implementation.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Harry Yang
-
嵌套类概要
从接口继承的嵌套类/接口 cn.taketoday.web.handler.function.ServerResponse
ServerResponse.BodyBuilder, ServerResponse.Context, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>, ServerResponse.SseBuilder -
字段概要
字段修饰符和类型字段说明private final CompletableFuture<ServerResponse>static final booleanprivate final Duration从类继承的字段 cn.taketoday.web.handler.function.ErrorHandlingServerResponse
logger从接口继承的字段 cn.taketoday.web.handler.function.ServerResponse
NONE_RETURN_VALUE -
构造器概要
构造器限定符构造器说明privateDefaultAsyncServerResponse(CompletableFuture<ServerResponse> futureResponse, Duration timeout) -
方法概要
修饰符和类型方法说明block()Blocks indefinitely until the future response is obtained.cn.taketoday.util.MultiValueMap<String,HttpCookie> cookies()Return the cookies of this response.static AsyncServerResponseCreate a (built) response with the given asynchronous response.private DeferredResult<ServerResponse>createDeferredResult(RequestContext request) private <R> Rdelegate(Function<ServerResponse, R> function) headers()Return the headers of this response.intReturn the status code of this response as integer.Return the status code of this response.(专用程序包) static voidwriteAsync(RequestContext request, DeferredResult<?> deferredResult) writeTo(RequestContext request, ServerResponse.Context context) Write this response to the given servlet response.从类继承的方法 cn.taketoday.web.handler.function.ErrorHandlingServerResponse
addErrorHandler, errorResponse, handleError
-
字段详细资料
-
reactiveStreamsPresent
public static final boolean reactiveStreamsPresent -
futureResponse
-
timeout
-
-
构造器详细资料
-
DefaultAsyncServerResponse
private DefaultAsyncServerResponse(CompletableFuture<ServerResponse> futureResponse, @Nullable Duration timeout)
-
-
方法详细资料
-
block
从接口复制的说明:AsyncServerResponseBlocks indefinitely until the future response is obtained.- 指定者:
block在接口中AsyncServerResponse
-
statusCode
从接口复制的说明:ServerResponseReturn the status code of this response.- 指定者:
statusCode在接口中ServerResponse- 返回:
- the status as an HttpStatusCode value
-
rawStatusCode
public int rawStatusCode()从接口复制的说明:ServerResponseReturn the status code of this response as integer.- 指定者:
rawStatusCode在接口中ServerResponse- 返回:
- the status as an integer
-
headers
从接口复制的说明:ServerResponseReturn the headers of this response.- 指定者:
headers在接口中ServerResponse
-
cookies
从接口复制的说明:ServerResponseReturn the cookies of this response.- 指定者:
cookies在接口中ServerResponse
-
delegate
-
writeTo
从接口复制的说明:ServerResponseWrite this response to the given servlet response.- 指定者:
writeTo在接口中ServerResponse- 参数:
request- the current requestcontext- the context to use when writing- 返回:
- a Web result to render, or
nullif handled directly - 抛出:
Exception
-
writeAsync
- 抛出:
Exception
-
createDeferredResult
-
create
从接口复制的说明:AsyncServerResponseCreate a (built) response with the given asynchronous response. ParameterasyncResponsecan be aCompletableFuture<ServerResponse>orPublisher<ServerResponse>(or any asynchronous producer of a singleServerResponsethat can be adapted via theReactiveAdapterRegistry).- 参数:
o- aCompletableFuture<ServerResponse>orPublisher<ServerResponse>timeout- maximum time period to wait for before timing out- 返回:
- the asynchronous response
-