C# (CSharp) Spring.Retry.Retry.Backoff Namespace

Classes

Name Description
BackOffInterruptedException Exception class signifiying that an attempt to back off using a IBackOffPolicy was interrupted, most likely by an ThreadInterruptedException during a call to Thread.Sleep(int).
ExponentialBackOffContext
ExponentialBackOffPolicy Implementation of IBackOffPolicy that increases the back off period for each retry attempt in a given set using the {@link Math#exp(double) exponential} function. This implementation is thread-safe and suitable for concurrent access. Modifications to the configuration do not affect any retry sets that are already in progress. The InitialInterval property controls the initial value passed to {@link Math#exp(double)} and the Multiplier property controls by how much this value is increased for each subsequent attempt.
ExponentialRandomBackOffContext
ExponentialRandomBackOffPolicy Implementation of {@link org.springframework.retry.backoff.ExponentialBackOffPolicy} that chooses a random multiple of the interval. The random multiple is selected based on how many iterations have occurred. This has shown to at least be useful in testing scenarios where excessive contention is generated by the test needing many retries. In test, usually threads are started at the same time, and thus stomp together onto the next interval. Using this {@link BackOffPolicy} can help avoid that scenario. Example: initialInterval = 50 multiplier = 2.0 maxInterval = 3000 numRetries = 5 ExponentialBackOffPolicy yields: [50, 100, 200, 400, 800] ExponentialRandomBackOffPolicy may yield [50, 100, 100, 100, 600] or [50, 100, 150, 400, 800]
FixedBackOffPolicy Implementation of IBackOffPolicy that pauses for a fixed period of time before continuing. A pause is implemented using Thread.Sleep(int). BackOffPeriod is thread-safe and it is safe to set BackOffPeriod during execution from multiple threads, however this may cause a single retry operation to have pauses of different intervals.
NoBackOffPolicy Implementation of IBackOffPolicy that performs a no-op and as such all retry operation in a given set proceed one after the other with no pause.
ObjectWaitSleeper Simple ISleeper implementation that just waits on a local Object.
StatelessBackOffPolicy Simple base class for IBackOffPolicy implementations that maintain no state across invocations.