Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static ServiceBusRetryWrapperBuilder OnException(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder,
                                                         Func <Exception, Task> exFunc) =>
 serviceBusRetryWrapperBuilder.With(onException: new Delegates.OnException(exFunc));
Ejemplo n.º 3
0
 public static ServiceBusRetryWrapperBuilder RetryCount(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder,
                                                        int retryCount,
                                                        int interval) =>
 serviceBusRetryWrapperBuilder.WithRetryCount(retryCount: retryCount)
 .WithInterval(interval);
Ejemplo n.º 4
0
 public static ServiceBusRetryWrapperBuilder RetryCount(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder,
                                                        int retryCount) =>
 serviceBusRetryWrapperBuilder.WithRetryCount(retryCount: retryCount);
Ejemplo n.º 5
0
 public static ServiceBusRetryWrapperBuilder OnDeadLettering(this ServiceBusRetryWrapperBuilder serviceBusRetryWrapperBuilder,
                                                             Func <Exception, Task> deadletteringFunc) =>
 serviceBusRetryWrapperBuilder.With(onDeadLettering: new Delegates.OnDeadLettering(deadletteringFunc));
Ejemplo n.º 6
0
 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);