Add StreamMessage.timeout()
Motivation:
Currently, the aggregate() and subscribe() methods of StreamMessage do not have the ability to set a timeout. This provides the ability to detect when a client or server has not responded for a period of time and handle it appropriately. Additionally, the timeout API can be used to detect idle streams by setting a timeout until the next message.
Modifications:
- Added the
TimeoutStreamMessageclass
- Wrap a
StreamMessageto provide timeout functionality - You can set a timeout feature by adding the
timeout()method to theStreamMessageinterface.
- Added the
TimeoutSubscriberclass
- Schedule a timeout for each message.
StreamTimeoutModeallows you to set different timeout modes.
- Added
StreamTimeoutModeenumeration
- Defines the
UNTIL_FIRST,UNTIL_NEXT, andUNTIL_EOSmodes.
- Added a timeout method
- Added the
timeoutmethod to theStreamMessage,HttpResponse, andHttpRequestinterfaces to provide the ability to set a timeout.
Result:
- Closes #5744
- This change adds timeout functionality to the
aggregate()andsubscribe()methods ofStreamMessageand HTTP requests/responses. - This allows idle streams to be detected and handled appropriately.
- You can use
StreamTimeoutModeto set the timeout between the arrival of the first message, the arrival of the next message, or the end of the stream.
๐ Build Scanยฎ (commit: 24245a4d7ec6f865e902d498fa2a816a27c53c96)
| Job name | Status | Build Scanยฎ |
|---|---|---|
| build-ubicloud-standard-8-jdk-8 | โ | https://ge.armeria.dev/s/onrrsbmyxwv7s |
| build-ubicloud-standard-8-jdk-21-snapshot-blockhound | โ | https://ge.armeria.dev/s/lo4aanlxcb2co |
| build-ubicloud-standard-8-jdk-17-min-java-17-coverage | โ (failure) | https://ge.armeria.dev/s/us7irp3ponwji |
| build-ubicloud-standard-8-jdk-17-min-java-11 | โ | https://ge.armeria.dev/s/woix3jlaukvdy |
| build-ubicloud-standard-8-jdk-17-leak | โ | https://ge.armeria.dev/s/4iy736pszda4g |
| build-ubicloud-standard-8-jdk-11 | โ | https://ge.armeria.dev/s/uddd2o3sck4ns |
| build-macos-12-jdk-21 | โ | https://ge.armeria.dev/s/vyf5i26tmjg4o |
Some of the descriptions in the Modifications field contain Korean.
Added StreamTimeoutMode enumeration UNTIL_FIRST, UNTIL_NEXT, UNTIL_EOS ๋ชจ๋๋ฅผ ์ ์ํฉ๋๋ค.
p.s. It's an interesting feature, so I'm watching with interest
Some of the descriptions in the Modifications field contain Korean.
Added StreamTimeoutMode enumeration UNTIL_FIRST, UNTIL_NEXT, UNTIL_EOS ๋ชจ๋๋ฅผ ์ ์ํฉ๋๋ค.
p.s. It's an interesting feature, so I'm watching with interest
Thank you for your interest.
Last but not least, please sign the ICLA.
Last but not least, please sign the ICLA.
I checked, thank you for your review.