Add support for Server-Sent Events
This commit adds ResponseBodyEmitter and SseEmitter (and also ResponseEntity<ResponseBodyEmitter> and ResponseEntity<SseEmitter>) as new return value types supported on @RequestMapping controller methods. See Javadoc on respective types for more details. Issue: SPR-12212
This commit is contained in:
@@ -31063,6 +31063,10 @@ The following are the supported return types:
|
||||
value from a thread of its own choosing.
|
||||
* A `ListenableFuture<?>` can be returned when the application wants to produce the return
|
||||
value from a thread of its own choosing.
|
||||
* A `ResponseBodyEmitter` can be returned to write multiple objects to the response
|
||||
asynchronously; also supported as the body within a `ResponseEntity`.
|
||||
* An `SseEmitter` can be returned to write Server-Sent Events to the response
|
||||
asynchronously; also supported as the body within a `ResponseEntity`.
|
||||
* Any other return type is considered to be a single model attribute to be exposed to
|
||||
the view, using the attribute name specified through `@ModelAttribute` at the method
|
||||
level (or the default attribute name based on the return type class name). The model
|
||||
|
||||
Reference in New Issue
Block a user