Interface IBackoffHandler
Interface for a backoff handler that is responsible for performing back-offs in the event that a given delegate throws an exception. The delegate will be retried after backing off for a certain period of time. The IBackoffHandler could be used with a IBackoffPolicy to determine whether a backoff should occur and how long to wait between back-offs.
public interface IBackoffHandler
Methods
BackoffAsync<T>(Func<Task<T>>, SQSMessagePollerConfiguration, CancellationToken)
Performs a back off in the event that a given delegate throws an exception. The delegate will be retried after backing off for a certain period of time.
Task<T> BackoffAsync<T>(Func<Task<T>> task, SQSMessagePollerConfiguration configuration, CancellationToken token)
Parameters
task
Func<Task<T>>The delegate for which to perform a backoff.
configuration
SQSMessagePollerConfigurationInternal configuration for polling messages from SQS.
token
CancellationTokenThe cancellation token used to cancel the request.
Returns
- Task<T>
Type Parameters
T