Skip to content

Commit

Permalink
Add partial class for retry settings
Browse files Browse the repository at this point in the history
Only added to V1, as V1Beta1 hasn't (and can't) go GA, so we can
take breaking changes there.
  • Loading branch information
jskeet committed Oct 17, 2019
1 parent 2da949d commit 95691ca
Showing 1 changed file with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using gaxgrpc = Google.Api.Gax.Grpc;
using grpccore = Grpc.Core;
using sys = System;

namespace Google.Cloud.Redis.V1
{
// This is a partial class introduced for backward compatibility with earlier versions.
public partial class CloudRedisSettings
{
/// <summary>
/// In previous releases, this property returned a filter used by default for "Idempotent" RPC methods.
/// It is now unused, and may not represent the current default behavior.
/// </summary>
[Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")]
public static sys::Predicate<grpccore::RpcException> IdempotentRetryFilter { get; } =
gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable);

/// <summary>
/// In previous releases, this property returned a filter used by default for "NonIdempotent" RPC methods.
/// It is now unused, and may not represent the current default behavior.
/// </summary>
[Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")]
public static sys::Predicate<grpccore::RpcException> NonIdempotentRetryFilter { get; } =
gaxgrpc::RetrySettings.FilterForStatusCodes();

/// <summary>
/// In previous releases, this method returned the backoff used by default for "Idempotent" RPC methods.
/// It is now unused, and may not represent the current default behavior.
/// </summary>
[Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")]
public static gaxgrpc::BackoffSettings GetDefaultRetryBackoff() => new gaxgrpc::BackoffSettings(
delay: sys::TimeSpan.FromMilliseconds(100),
maxDelay: sys::TimeSpan.FromMilliseconds(60000),
delayMultiplier: 1.3
);

/// <summary>
/// In previous releases, this method returned the backoff used by default for "NonIdempotent" RPC methods.
/// It is now unused, and may not represent the current default behavior.
/// </summary>
[Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")]
public static gaxgrpc::BackoffSettings GetDefaultTimeoutBackoff() => new gaxgrpc::BackoffSettings(
delay: sys::TimeSpan.FromMilliseconds(20000),
maxDelay: sys::TimeSpan.FromMilliseconds(20000),
delayMultiplier: 1.0
);
}
}

0 comments on commit 95691ca

Please sign in to comment.