Skip to content

Commit 5f59858

Browse files
committed
SseEmitter exposes super constructor with timeout value
Issue: SPR-13446
1 parent c4f5a0f commit 5f59858

File tree

1 file changed

+20
-0
lines changed
  • spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation

1 file changed

+20
-0
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,26 @@ public class SseEmitter extends ResponseBodyEmitter {
3939
static final MediaType TEXT_PLAIN = new MediaType("text", "plain", Charset.forName("UTF-8"));
4040

4141

42+
/**
43+
* Create a new SseEmitter instance.
44+
*/
45+
public SseEmitter() {
46+
super();
47+
}
48+
49+
/**
50+
* Create a SseEmitter with a custom timeout value.
51+
* <p>By default not set in which case the default configured in the MVC
52+
* Java Config or the MVC namespace is used, or if that's not set, then the
53+
* timeout depends on the default of the underlying server.
54+
* @param timeout timeout value in milliseconds
55+
* @since 4.2.2
56+
*/
57+
public SseEmitter(Long timeout) {
58+
super(timeout);
59+
}
60+
61+
4262
@Override
4363
protected void extendResponse(ServerHttpResponse outputMessage) {
4464
super.extendResponse(outputMessage);

0 commit comments

Comments
 (0)