Class RetryOptions (4.4.0)

public sealed class RetryOptions

Options that define retry logic for requests that failed.

Inheritance

Object > RetryOptions

Namespace

Google.Cloud.Diagnostics.Common

Assembly

Google.Cloud.Diagnostics.Common.dll

Fields

DefaultBufferSize

public static readonly int DefaultBufferSize

The default buffer size in bytes. 2^18 = 262144.

Field Value
TypeDescription
Int32

DefaultRetryAttempts

public static readonly int DefaultRetryAttempts

The default number of retry attempts.

Field Value
TypeDescription
Int32

DefaultRetryInterval

public static readonly TimeSpan DefaultRetryInterval

The default wait time between retries.

Field Value
TypeDescription
TimeSpan

Properties

BufferOverflow

public BufferOverflow BufferOverflow { get; }

How to handle a full buffer, only used for Retry.

Property Value
TypeDescription
BufferOverflow

BufferSizeBytes

public int BufferSizeBytes { get; }

The size of the buffer in bytes, only used for Retry.

Property Value
TypeDescription
Int32

ExceptionHandling

public ExceptionHandling ExceptionHandling { get; }

How exceptions are handled.

Property Value
TypeDescription
ExceptionHandling

RetryAttempts

public int RetryAttempts { get; }

The number of attempts to retry sending information, only used for Retry.

Property Value
TypeDescription
Int32

RetryInterval

public TimeSpan RetryInterval { get; }

The amount of time to wait between retries, only used for Retry.

Property Value
TypeDescription
TimeSpan

RetryType

public RetryType RetryType { get; }

The type of retry to make.

Property Value
TypeDescription
RetryType

Methods

NoRetry(ExceptionHandling)

public static RetryOptions NoRetry(ExceptionHandling exceptionHandling = ExceptionHandling.Ignore)

Creates a RetryOptions for None.

Parameter
NameDescription
exceptionHandlingExceptionHandling

Optional, how exceptions should be handled. Defaults to Ignore.

Returns
TypeDescription
RetryOptions

Retry(ExceptionHandling, BufferOverflow, Nullable<Int32>, Nullable<TimeSpan>, Nullable<Int32>)

public static RetryOptions Retry(ExceptionHandling exceptionHandling = ExceptionHandling.Ignore, BufferOverflow bufferOverflow = BufferOverflow.IgnoreNewEntries, int? bufferSizeBytes = default(int? ), TimeSpan? retryInterval = default(TimeSpan? ), int? retryAttempts = default(int? ))

Creates a RetryOptions for Retry.

Parameters
NameDescription
exceptionHandlingExceptionHandling

Optional, how exceptions should be handled. Defaults to Ignore.

bufferOverflowBufferOverflow

Optional, how a buffer overflow should be handled. Defaults to IgnoreNewEntries.

bufferSizeBytesNullable<Int32>

Optional, the size of the buffer to be used in bytes. Defaults to DefaultBufferSize.

retryIntervalNullable<TimeSpan>

Optional, the time between retries. Default to DefaultRetryInterval.

retryAttemptsNullable<Int32>

Optional, the number of retry attempts. Defaults to DefaultRetryAttempts.

Returns
TypeDescription
RetryOptions