Table of Contents

Class BackoffStrategy

Namespace
Styra.Opa.OpenApi.Utils.Retries
Assembly
Styra.Opa.dll
public class BackoffStrategy
Inheritance
BackoffStrategy
Inherited Members

Constructors

BackoffStrategy(long, long, long, double, double)

Configures the exponential backoff strategy.

public BackoffStrategy(long initialIntervalMs, long maxIntervalMs, long maxElapsedTimeMs, double exponent, double jitterFactor = 0.5)

Parameters

initialIntervalMs long

The initial interval in milliseconds.

maxIntervalMs long

The maximum interval in milliseconds.

maxElapsedTimeMs long

The maximum elapsed time in milliseconds.

exponent double

The base factor used to compute the exponential interval

jitterFactor double

The jitter factor used to randomize the backoff interval

Remarks

The duration between consecutive attempts is calculated as follows: intervalMs = min(maxIntervalMs, initialIntervalMs*(baseFactor^attempts) +/- r) where baseFactor (also referred to as "exponent") is the multiplicative factor and r a random value between 0 and jitterFactor*intervalMs.

Fields

BaseFactor

public readonly double BaseFactor

Field Value

double

InitialIntervalMs

public readonly long InitialIntervalMs

Field Value

long

JitterFactor

public readonly double JitterFactor

Field Value

double

MaxElapsedTimeMs

public readonly long MaxElapsedTimeMs

Field Value

long

MaxIntervalMs

public readonly long MaxIntervalMs

Field Value

long