Doc use of reactive types in Spring MVC controllers

Issue: SPR-15365
This commit is contained in:
Rossen Stoyanchev
2017-04-04 17:32:24 -04:00
parent f716c8e9bc
commit f293c4d84b
4 changed files with 111 additions and 59 deletions

View File

@@ -56,6 +56,11 @@ public class AsyncSupportConfigurer {
* highly recommended to change that default in production since the simple
* executor does not re-use threads.
*
* <p>As of 5.0 this executor is also used when a controller returns a reactive
* type that does streaming (e.g. "text/event-stream" or
* "application/stream+json") for the blocking writes to the
* {@link javax.servlet.ServletOutputStream}.
*
* @param taskExecutor the task executor instance to use by default
*/
public AsyncSupportConfigurer setTaskExecutor(AsyncTaskExecutor taskExecutor) {

View File

@@ -231,9 +231,14 @@
<xsd:attribute name="task-executor" type="xsd:string">
<xsd:annotation>
<xsd:documentation source="java:org.springframework.core.task.AsyncTaskExecutor"><![CDATA[
The bean name of a default AsyncTaskExecutor to use when a controller method returns a {@link Callable}.
The bean name of a default AsyncTaskExecutor to use when a controller method returns a "Callable".
Controller methods can override this default on a per-request basis by returning an AsyncTask.
By default, a SimpleAsyncTaskExecutor is used which does not re-use threads and is not recommended for production.
As of 5.0 this executor is also used when a controller returns a reactive type that does streaming
(e.g. "text/event-stream" or "application/stream+json") for the blocking writes to the
"javax.servlet.ServletOutputStream".
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">