Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the RetryTask class.
 /// </summary>
 /// <param name="retryPolicy">The retry policy.</param>
 /// <param name="action">The action to process.</param>
 /// <param name="exceptionHandler">The exception handler.</param>
 public RetryTask(T retryPolicy, Action <RetryEventArgs> action = null, Reflection.ExceptionHandler exceptionHandler = null)
 {
     RetryPolicy = retryPolicy;
     if (action != null)
     {
         Processing += (sender, ev) => action(ev);
     }
     ExceptionHandler = exceptionHandler ?? new Reflection.ExceptionHandler();
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the RetryTask class.
 /// </summary>
 /// <param name="retryPolicy">The retry policy.</param>
 /// <param name="exceptionHandler">The exception handler.</param>
 public RetryTask(T retryPolicy, Reflection.ExceptionHandler exceptionHandler)
     : this(retryPolicy, null as Action <RetryEventArgs>, exceptionHandler)
 {
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the RetryTask class.
 /// </summary>
 /// <param name="retryPolicy">The retry policy.</param>
 /// <param name="action">The action to process.</param>
 /// <param name="exceptionHandler">The exception handler.</param>
 public RetryTask(T retryPolicy, Action action, Reflection.ExceptionHandler exceptionHandler = null)
     : this(retryPolicy, action is null ? null : ev => action(), exceptionHandler)
 {
 }