Search in sources :

Example 1 with DeferredResult

use of cn.taketoday.web.context.async.DeferredResult in project today-infrastructure by TAKETODAY.

the class ErrorPageFilterTests method setUpAsyncDispatch.

private void setUpAsyncDispatch() throws Exception {
    this.request.setAsyncSupported(true);
    this.request.setAsyncStarted(true);
    DeferredResult<String> result = new DeferredResult<>();
    ServletRequestContext context = new ServletRequestContext(null, request, response);
    WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(context);
    asyncManager.setAsyncRequest(new StandardServletAsyncWebRequest(context));
    asyncManager.startDeferredResultProcessing(result);
}
Also used : WebAsyncManager(cn.taketoday.web.context.async.WebAsyncManager) StandardServletAsyncWebRequest(cn.taketoday.web.context.async.StandardServletAsyncWebRequest) ServletRequestContext(cn.taketoday.web.servlet.ServletRequestContext) DeferredResult(cn.taketoday.web.context.async.DeferredResult)

Example 2 with DeferredResult

use of cn.taketoday.web.context.async.DeferredResult in project today-framework by TAKETODAY.

the class ErrorPageFilterTests method setUpAsyncDispatch.

private void setUpAsyncDispatch() throws Exception {
    this.request.setAsyncSupported(true);
    this.request.setAsyncStarted(true);
    DeferredResult<String> result = new DeferredResult<>();
    ServletRequestContext context = new ServletRequestContext(null, request, response);
    WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(context);
    asyncManager.setAsyncRequest(new StandardServletAsyncWebRequest(request, response));
    asyncManager.startDeferredResultProcessing(result);
}
Also used : WebAsyncManager(cn.taketoday.web.context.async.WebAsyncManager) StandardServletAsyncWebRequest(cn.taketoday.web.context.async.StandardServletAsyncWebRequest) ServletRequestContext(cn.taketoday.web.servlet.ServletRequestContext) DeferredResult(cn.taketoday.web.context.async.DeferredResult)

Aggregations

DeferredResult (cn.taketoday.web.context.async.DeferredResult)2 StandardServletAsyncWebRequest (cn.taketoday.web.context.async.StandardServletAsyncWebRequest)2 WebAsyncManager (cn.taketoday.web.context.async.WebAsyncManager)2 ServletRequestContext (cn.taketoday.web.servlet.ServletRequestContext)2