Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
Currently, there is no timeout for StreamMessage's aggregate() or subscribe(). If we want to give a timeout for HttpRequest.aggregate(), a separate scheduler needs to be run to abort the request if it is not completed within the given time.
enum StreamTimeoutMode {
UNTIL_FIRST,
// Maybe the default one
UNTIL_NEXT,
UNTIL_EOS // or UNTIL_LAST
}
StreamMessage<Object> stream = ...;
// Sets a timeout for each message to 5 seconds.
stream.timeout(5_seconds).subscribe(....);
// UNTIL_EOS will be useful for unary requests.
HttpRequest req = ...;
req.timeout(StreamTimeoutMode.UNTIL_EOS, 10_seconds).aggregate();
req.aggregate(10_seconds); // Shortcut
// UNTIL_NEXT will be useful for stream requests such as gRPC streams or WebSocket.
WebSocket input = ...;
input.timeout(UNTIL_NEXT, 3_seconds).subscribe(...);
Currently, there is no timeout for
StreamMessage
'saggregate()
orsubscribe()
. If we want to give a timeout forHttpRequest.aggregate()
, a separate scheduler needs to be run to abort the request if it is not completed within the given time.The timeout API can also be used to detect an idle stream by setting a timeout until the next message. https://github.com/line/armeria/pull/5713#issuecomment-2150498394