public static async Task ExecuteAsync(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder, Func <Task> execution) { var handler = ServiceBusRetryHandler.Instance; serviceBusRetryWrapperBuilder.With(execution: new Delegates.Execution(execution)); var wrapper = serviceBusRetryWrapperBuilder.Build(); await handler.Handle(wrapper).ConfigureAwait(false); }
public static ServiceBusRetryWrapperBuilder OnException(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder, Func <Exception, Task> exFunc) => serviceBusRetryWrapperBuilder.With(onException: new Delegates.OnException(exFunc));
public static ServiceBusRetryWrapperBuilder RetryCount(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder, int retryCount, int interval) => serviceBusRetryWrapperBuilder.WithRetryCount(retryCount: retryCount) .WithInterval(interval);
public static ServiceBusRetryWrapperBuilder RetryCount(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder, int retryCount) => serviceBusRetryWrapperBuilder.WithRetryCount(retryCount: retryCount);
public static ServiceBusRetryWrapperBuilder OnDeadLettering(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder, Func <Exception, Task> deadletteringFunc) => serviceBusRetryWrapperBuilder.With(onDeadLettering: new Delegates.OnDeadLettering(deadletteringFunc));
public static ServiceBusRetryWrapperBuilder OnScheduling(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder, Func <Exception, DateTimeOffset, Task> schedulingFunc) => serviceBusRetryWrapperBuilder.With(onScheduling: new Delegates.OnScheduling(schedulingFunc));
private static ServiceBusRetryWrapperBuilder Apply <TException>(Func <Exception, bool> when) where TException : Exception => ServiceBusRetryWrapperBuilder.New() .With(when);