Skip to content

Commit

Permalink
Add partial class for retry settings (compatibility)
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Oct 23, 2019
1 parent 5514b75 commit ab7762c
Showing 1 changed file with 63 additions and 0 deletions.
@@ -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.Scheduler.V1
{
// This is a partial class introduced for backward compatibility with earlier versions.
public partial class CloudSchedulerSettings
{
/// <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 ab7762c

Please sign in to comment.