/// <summary> /// Constructs an instance with the given configuration, and the default jitter. /// </summary> /// <param name="retryBackoff">The backoff policy for the time between retries. Must not be null.</param> /// <param name="timeoutBackoff">The backoff policy for timeouts of retries. Must not be null.</param> /// <param name="totalExpiration">The total expiration, across all retries. Must not be null.</param> /// <param name="retryFilter">A predicate to determine whether or not a particular exception should cause the operation to be retried, /// or null for the default filter.</param> public RetrySettings( BackoffSettings retryBackoff, BackoffSettings timeoutBackoff, Expiration totalExpiration, Predicate <RpcException> retryFilter) : this(retryBackoff, timeoutBackoff, totalExpiration, retryFilter, null) { }
/// <summary> /// Constructs an instance with the given configuration, and the default jitter. /// </summary> /// <param name="retryBackoff">The backoff policy for the time between retries. Must not be null.</param> /// <param name="timeoutBackoff">The backoff policy for timeouts of retries. Must not be null.</param> /// <param name="totalExpiration">The total expiration, across all retries. Must not be null.</param> /// <param name="retryFilter">A predicate to determine whether or not a particular exception should cause the operation to be retried, /// or null for the default filter.</param> public RetrySettings( BackoffSettings retryBackoff, BackoffSettings timeoutBackoff, Expiration totalExpiration, Predicate<RpcException> retryFilter) : this(retryBackoff, timeoutBackoff, totalExpiration, retryFilter, null) { }
/// <summary> /// Constructs an instance with the given configuration. /// </summary> /// <param name="retryBackoff">The backoff policy for the time between retries. Must not be null.</param> /// <param name="timeoutBackoff">The backoff policy for timeouts of retries. Must not be null.</param> /// <param name="totalExpiration">The total expiration, across all retries. Must not be null.</param> /// <param name="retryFilter">A predicate to determine whether or not a particular exception should cause the operation to be retried, /// or null for the default filter.</param> /// <param name="delayJitter">The delay jitter to apply for delays, or null for the defautl (random) jitter.</param> public RetrySettings( BackoffSettings retryBackoff, BackoffSettings timeoutBackoff, Expiration totalExpiration, Predicate <RpcException> retryFilter, IJitter delayJitter) { RetryBackoff = GaxPreconditions.CheckNotNull(retryBackoff, nameof(retryBackoff)); TimeoutBackoff = GaxPreconditions.CheckNotNull(timeoutBackoff, nameof(timeoutBackoff)); TotalExpiration = GaxPreconditions.CheckNotNull(totalExpiration, nameof(totalExpiration)); RetryFilter = retryFilter ?? DefaultFilter; DelayJitter = delayJitter ?? RandomJitter; }
/// <summary> /// Constructs an instance with the given backoff configuration, the default RPC filter and /// jitter. /// </summary> /// <param name="retryBackoff">The backoff policy for the time between retries. Must not be null.</param> /// <param name="timeoutBackoff">The backoff policy for timeouts of retries. Must not be null.</param> /// <param name="totalExpiration">The total expiration, across all retries. Must not be null.</param> public RetrySettings( BackoffSettings retryBackoff, BackoffSettings timeoutBackoff, Expiration totalExpiration) : this(retryBackoff, timeoutBackoff, totalExpiration, null, null) { }
/// <summary> /// Constructs an instance with the given configuration. /// </summary> /// <param name="retryBackoff">The backoff policy for the time between retries. Must not be null.</param> /// <param name="timeoutBackoff">The backoff policy for timeouts of retries. Must not be null.</param> /// <param name="totalExpiration">The total expiration, across all retries. Must not be null.</param> /// <param name="retryFilter">A predicate to determine whether or not a particular exception should cause the operation to be retried, /// or null for the default filter.</param> /// <param name="delayJitter">The delay jitter to apply for delays, or null for the defautl (random) jitter.</param> public RetrySettings( BackoffSettings retryBackoff, BackoffSettings timeoutBackoff, Expiration totalExpiration, Predicate<RpcException> retryFilter, IJitter delayJitter) { RetryBackoff = GaxPreconditions.CheckNotNull(retryBackoff, nameof(retryBackoff)); TimeoutBackoff = GaxPreconditions.CheckNotNull(timeoutBackoff, nameof(timeoutBackoff)); TotalExpiration = GaxPreconditions.CheckNotNull(totalExpiration, nameof(totalExpiration)); RetryFilter = retryFilter ?? DefaultFilter; DelayJitter = delayJitter ?? RandomJitter; }