@BetaApi(value="The surface for streaming is not stable yet and may change in the future.") public final class ServerStreamingCallSettings<RequestT,ResponseT> extends StreamingCallSettings<RequestT,ResponseT>
ServerStreamingCallable.
This class includes settings that are applicable to all server streaming calls, which currently just includes retries and watchdog timers.
The watchdog timer is configured via idleTimeout. The watchdog will terminate any
stream that has not has seen any demand (via StreamController.request(int)) in the
configured interval. To turn off idle checks, set the interval to Duration.ZERO.
Retry configuration allows for the stream to be restarted and resumed. It is composed of 3 parts: the retryable codes, the retry settings and the stream resumption strategy. The retryable codes indicate which codes cause a retry to occur, the retry settings configure the retry logic when the retry needs to happen, and the stream resumption strategy composes the request to resume the stream. To turn off retries, set the retryable codes to the empty set.
The retry settings have slightly different semantics when compared to unary RPCs:
StreamController.request(int) and the ResponseObserver receiving the message.
StubSettings.getStreamWatchdogCheckInterval().
| Modifier and Type | Class and Description |
|---|---|
static class |
ServerStreamingCallSettings.Builder<RequestT,ResponseT> |
| Modifier and Type | Method and Description |
|---|---|
org.threeten.bp.Duration |
getIdleTimeout()
See the class documentation of
ServerStreamingCallSettings for a description of what
the idleTimeout does. |
StreamResumptionStrategy<RequestT,ResponseT> |
getResumptionStrategy()
See the class documentation of
ServerStreamingCallSettings and StreamResumptionStrategy for a description of what the StreamResumptionStrategy does. |
Set<StatusCode.Code> |
getRetryableCodes()
See the class documentation of
ServerStreamingCallSettings for a description of what
retryableCodes do. |
RetrySettings |
getRetrySettings()
See the class documentation of
ServerStreamingCallSettings for a description of what
retrySettings do. |
static <RequestT,ResponseT> |
newBuilder() |
ServerStreamingCallSettings.Builder<RequestT,ResponseT> |
toBuilder() |
String |
toString() |
@Nonnull public Set<StatusCode.Code> getRetryableCodes()
ServerStreamingCallSettings for a description of what
retryableCodes do.@Nonnull public RetrySettings getRetrySettings()
ServerStreamingCallSettings for a description of what
retrySettings do.@Nonnull public StreamResumptionStrategy<RequestT,ResponseT> getResumptionStrategy()
ServerStreamingCallSettings and StreamResumptionStrategy for a description of what the StreamResumptionStrategy does.@Nonnull public org.threeten.bp.Duration getIdleTimeout()
ServerStreamingCallSettings for a description of what
the idleTimeout does.public ServerStreamingCallSettings.Builder<RequestT,ResponseT> toBuilder()
toBuilder in class StreamingCallSettings<RequestT,ResponseT>public static <RequestT,ResponseT> ServerStreamingCallSettings.Builder<RequestT,ResponseT> newBuilder()