/// <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(); }
/// <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) { }
/// <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) { }