Interface IBackoffPolicy
Interface for a Backoff Policy which determines if a IBackoffHandler should perform a backoff and how long to wait before performing the next backoff.
public interface IBackoffPolicy
Methods
RetrieveBackoffTime(int)
Performs a calculation based on the number of retries to determine how long the IBackoffHandler will wait before performing the next backoff.
TimeSpan RetrieveBackoffTime(int numberOfRetries)
Parameters
numberOfRetries
intThe number of times the IBackoffHandler has retried a request after performing a backoff.
Returns
- TimeSpan
A TimeSpan that indicates how long the IBackoffHandler should wait.
ShouldBackoff(Exception, SQSMessagePollerConfiguration)
Determines if a IBackoffHandler should perform a backoff.
bool ShouldBackoff(Exception exception, SQSMessagePollerConfiguration configuration)
Parameters
exception
ExceptionThe exception that triggered a backoff in the IBackoffHandler.
configuration
SQSMessagePollerConfigurationInternal configuration for polling messages from SQS.
Returns
- bool
A boolean that indicates whether the IBackoffHandler should backoff or not.