类 AsyncSupportConfigurer
java.lang.Object
cn.taketoday.web.config.AsyncSupportConfigurer
Helps with configuring options for asynchronous request processing.
- 从以下版本开始:
- 4.0 2022/4/9 10:56
- 作者:
- Rossen Stoyanchev, Harry Yang
-
字段概要
字段修饰符和类型字段说明private final List<CallableProcessingInterceptor>private final List<DeferredResultProcessingInterceptor>private cn.taketoday.core.task.AsyncTaskExecutorprivate Long -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected List<CallableProcessingInterceptor>protected List<DeferredResultProcessingInterceptor>protected cn.taketoday.core.task.AsyncTaskExecutorprotected LongregisterCallableInterceptors(CallableProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aCallable.registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aDeferredResult.setDefaultTimeout(long timeout) Specify the amount of time, in milliseconds, before asynchronous request handling times out.setTaskExecutor(cn.taketoday.core.task.AsyncTaskExecutor taskExecutor) The provided task executor is used for the following: HandleCallablecontroller method return values.
-
字段详细资料
-
taskExecutor
@Nullable private cn.taketoday.core.task.AsyncTaskExecutor taskExecutor -
timeout
-
callableInterceptors
-
deferredResultInterceptors
-
-
构造器详细资料
-
AsyncSupportConfigurer
public AsyncSupportConfigurer()
-
-
方法详细资料
-
setTaskExecutor
public AsyncSupportConfigurer setTaskExecutor(cn.taketoday.core.task.AsyncTaskExecutor taskExecutor) The provided task executor is used for the following:- Handle
Callablecontroller method return values. - Perform blocking writes when streaming to the response through a reactive (e.g. Reactor, RxJava) controller method return value.
If your application has controllers with such return types, please configure an
AsyncTaskExecutoras the one used by default is not suitable for production under load.- 参数:
taskExecutor- the task executor instance to use by default
- Handle
-
setDefaultTimeout
Specify the amount of time, in milliseconds, before asynchronous request handling times out. In Servlet 3, the timeout begins after the main request processing thread has exited and ends when the request is dispatched again for further processing of the concurrently produced result.If this value is not set, the default timeout of the underlying implementation is used.
- 参数:
timeout- the timeout value in milliseconds
-
registerCallableInterceptors
public AsyncSupportConfigurer registerCallableInterceptors(CallableProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aCallable.- 参数:
interceptors- the interceptors to register
-
registerDeferredResultInterceptors
public AsyncSupportConfigurer registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors) Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns aDeferredResult.- 参数:
interceptors- the interceptors to register
-
getTaskExecutor
@Nullable protected cn.taketoday.core.task.AsyncTaskExecutor getTaskExecutor() -
getTimeout
-
getCallableInterceptors
-
getDeferredResultInterceptors
-