Table of Contents

Class RetryPolicy

Namespace
Temporalio.Api.Common.V1
Assembly
Temporalio.dll

How retries ought to be handled, usable by both workflows and activities

public sealed class RetryPolicy : IMessage<RetryPolicy>, IEquatable<RetryPolicy>, IDeepCloneable<RetryPolicy>, IBufferMessage, IMessage
Inheritance
RetryPolicy
Implements
IMessage<RetryPolicy>
IDeepCloneable<RetryPolicy>
IBufferMessage
IMessage
Inherited Members

Constructors

RetryPolicy()

public RetryPolicy()

RetryPolicy(RetryPolicy)

public RetryPolicy(RetryPolicy other)

Parameters

other RetryPolicy

Fields

BackoffCoefficientFieldNumber

Field number for the "backoff_coefficient" field.

public const int BackoffCoefficientFieldNumber = 2

Field Value

int

InitialIntervalFieldNumber

Field number for the "initial_interval" field.

public const int InitialIntervalFieldNumber = 1

Field Value

int

MaximumAttemptsFieldNumber

Field number for the "maximum_attempts" field.

public const int MaximumAttemptsFieldNumber = 4

Field Value

int

MaximumIntervalFieldNumber

Field number for the "maximum_interval" field.

public const int MaximumIntervalFieldNumber = 3

Field Value

int

NonRetryableErrorTypesFieldNumber

Field number for the "non_retryable_error_types" field.

public const int NonRetryableErrorTypesFieldNumber = 5

Field Value

int

Properties

BackoffCoefficient

Coefficient used to calculate the next retry interval. The next retry interval is previous interval multiplied by the coefficient. Must be 1 or larger.

public double BackoffCoefficient { get; set; }

Property Value

double

Descriptor

public static MessageDescriptor Descriptor { get; }

Property Value

MessageDescriptor

InitialInterval

Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.

public Duration InitialInterval { get; set; }

Property Value

Duration

MaximumAttempts

Maximum number of attempts. When exceeded the retries stop even if not expired yet. 1 disables retries. 0 means unlimited (up to the timeouts)

public int MaximumAttempts { get; set; }

Property Value

int

MaximumInterval

Maximum interval between retries. Exponential backoff leads to interval increase. This value is the cap of the increase. Default is 100x of the initial interval.

public Duration MaximumInterval { get; set; }

Property Value

Duration

NonRetryableErrorTypes

Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that this is not a substring match, the error type (not message) must match exactly.

public RepeatedField<string> NonRetryableErrorTypes { get; }

Property Value

RepeatedField<string>

Parser

public static MessageParser<RetryPolicy> Parser { get; }

Property Value

MessageParser<RetryPolicy>

Methods

CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

public int CalculateSize()

Returns

int

The number of bytes required to write this message to a coded output stream.

Clone()

Creates a deep clone of this object.

public RetryPolicy Clone()

Returns

RetryPolicy

A deep clone of this object.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object other)

Parameters

other object

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(RetryPolicy)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(RetryPolicy other)

Parameters

other RetryPolicy

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

MergeFrom(CodedInputStream)

Merges the data from the specified coded input stream with the current message.

public void MergeFrom(CodedInputStream input)

Parameters

input CodedInputStream

Remarks

See the user guide for precise merge semantics.

MergeFrom(RetryPolicy)

Merges the given message into this one.

public void MergeFrom(RetryPolicy other)

Parameters

other RetryPolicy

Remarks

See the user guide for precise merge semantics.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

WriteTo(CodedOutputStream)

Writes the data to the given coded output stream.

public void WriteTo(CodedOutputStream output)

Parameters

output CodedOutputStream

Coded output stream to write the data to. Must not be null.