Closed spring-projects-issues closed 9 years ago
Sergey Parakhin commented
Hi, I have a question - Why did you add constructor with timeout only for ResponseBodyEmitter, but not for SseEmitter?
Rossen Stoyanchev commented
Yep, I just noticed that myself. I'll open a separate ticket.
Rossen Stoyanchev commented
See #18026, thanks.
Sergey Parakhin commented
Thank you!
Bernhard Frauendienst opened SPR-13104 and commented
As discussed in #16826, request handler methods returning a ResponseBodyEmitter (or a subclass like SseEmitter) have no way of specifying a request-specific timeout to be set on the request's AsyncContext. The only way to specify that timeout is using the global default value.
However, most ResponseBodyEmitter connections are explicitly created to be long-running, especially in the Server-Sent Event case (SseEmitter), where the connection is created as an async back-channel to the client. As such, those request handlers will in most cases want to set a much higher timeout value than the one appropriate for single-result async tasks.
Therefore, the possibility to specify a per-request timeout value should be added to the ResponseBodyEmitter (probably similar to the property in DeferredResult).
Affects: 4.2 RC1
Issue Links:
16826 HTTP Streaming and Server-Sent Events (SSE)
18026 SseEmitter does not expose super constructor with timeout value