类 AsyncWebRequest
java.lang.Object
cn.taketoday.web.context.async.AsyncWebRequest
- 直接已知子类:
StandardServletAsyncWebRequest
Extends
RequestContext with methods for asynchronous request processing.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Harry Yang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddCompletionHandler(Runnable runnable) Add a handler to invoke when request processing completes.voidaddErrorHandler(Consumer<Throwable> exceptionHandler) Add a handler to invoke when an error occurred while concurrent handling of a request.voidaddTimeoutHandler(Runnable timeoutHandler) Add a handler to invoke when concurrent handling has timed out.abstract voidDispatch the request to the container in order to resume processing after concurrent execution in an application thread.protected final voiddispatchEvent(ArrayList<Runnable> handler) booleanWhether asynchronous processing has completed.abstract booleanWhether the request is in async mode following a call tostartAsync().voidsetTimeout(Long timeout) Set the time required for concurrent handling to complete.abstract voidMark the start of asynchronous request processing so that when the main processing thread exits, the response remains open for further processing in another thread.
-
字段详细资料
-
timeout
-
asyncCompleted
-
timeoutHandlers
-
completionHandlers
-
exceptionHandlers
-
-
构造器详细资料
-
AsyncWebRequest
public AsyncWebRequest()
-
-
方法详细资料
-
setTimeout
Set the time required for concurrent handling to complete. This property should not be set when concurrent handling is in progress, i.e. whenisAsyncStarted()istrue.- 参数:
timeout- amount of time in milliseconds;nullmeans no timeout, i.e. rely on the default timeout of the container.
-
addTimeoutHandler
Add a handler to invoke when concurrent handling has timed out. -
addErrorHandler
Add a handler to invoke when an error occurred while concurrent handling of a request. -
addCompletionHandler
Add a handler to invoke when request processing completes. -
isAsyncComplete
public boolean isAsyncComplete()Whether asynchronous processing has completed. -
dispatchEvent
-
startAsync
public abstract void startAsync()Mark the start of asynchronous request processing so that when the main processing thread exits, the response remains open for further processing in another thread.- 抛出:
IllegalStateException- if async processing has completed or is not supported
-
isAsyncStarted
public abstract boolean isAsyncStarted()Whether the request is in async mode following a call tostartAsync(). Returns "false" if asynchronous processing never started, has completed, or the request was dispatched for further processing. -
dispatch
Dispatch the request to the container in order to resume processing after concurrent execution in an application thread.
-