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 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));