Class ServerStreamingCallSettings<RequestT,ResponseT>
- java.lang.Object
-
- com.google.api.gax.rpc.StreamingCallSettings<RequestT,ResponseT>
-
- com.google.api.gax.rpc.ServerStreamingCallSettings<RequestT,ResponseT>
-
public final class ServerStreamingCallSettings<RequestT,ResponseT> extends StreamingCallSettings<RequestT,ResponseT>
A settings class to configure aServerStreamingCallable.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 (viaStreamController.request(int)) in the configured interval. To turn off idle checks, set the interval toDuration.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:
- retry delays are reset to the initial value as soon as a response is received.
- RPC timeouts are reset to the initial value as soon as a response is received.
- RPC timeouts apply to the time interval between caller demanding more responses via
StreamController.request(int)and theResponseObserverreceiving the message. - RPC timeouts are best effort and are checked once every
StubSettings.getStreamWatchdogCheckInterval(). - Attempt counts are reset as soon as a response is received. This means that max attempts is the maximum number of failures in a row.
- totalTimeout still applies to the entire stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerStreamingCallSettings.Builder<RequestT,ResponseT>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.threeten.bp.DurationgetIdleTimeout()See the class documentation ofServerStreamingCallSettingsfor a description of what theidleTimeoutdoes.StreamResumptionStrategy<RequestT,ResponseT>getResumptionStrategy()See the class documentation ofServerStreamingCallSettingsandStreamResumptionStrategyfor a description of what the StreamResumptionStrategy does.java.util.Set<StatusCode.Code>getRetryableCodes()See the class documentation ofServerStreamingCallSettingsfor a description of what retryableCodes do.RetrySettingsgetRetrySettings()See the class documentation ofServerStreamingCallSettingsfor a description of what retrySettings do.static <RequestT,ResponseT>
ServerStreamingCallSettings.Builder<RequestT,ResponseT>newBuilder()ServerStreamingCallSettings.Builder<RequestT,ResponseT>toBuilder()java.lang.StringtoString()
-
-
-
Method Detail
-
getRetryableCodes
@Nonnull public java.util.Set<StatusCode.Code> getRetryableCodes()
See the class documentation ofServerStreamingCallSettingsfor a description of what retryableCodes do.
-
getRetrySettings
@Nonnull public RetrySettings getRetrySettings()
See the class documentation ofServerStreamingCallSettingsfor a description of what retrySettings do.
-
getResumptionStrategy
@Nonnull public StreamResumptionStrategy<RequestT,ResponseT> getResumptionStrategy()
See the class documentation ofServerStreamingCallSettingsandStreamResumptionStrategyfor a description of what the StreamResumptionStrategy does.
-
getIdleTimeout
@Nonnull public org.threeten.bp.Duration getIdleTimeout()
See the class documentation ofServerStreamingCallSettingsfor a description of what theidleTimeoutdoes.
-
toBuilder
public ServerStreamingCallSettings.Builder<RequestT,ResponseT> toBuilder()
- Overrides:
toBuilderin classStreamingCallSettings<RequestT,ResponseT>
-
newBuilder
public static <RequestT,ResponseT> ServerStreamingCallSettings.Builder<RequestT,ResponseT> newBuilder()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-