/// <inheritdoc /> /// <summary> /// Create with retry strategy, 20ms delay, general aspect and asynchronous general aspect. /// </summary> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> protected WithAspectAndRetryAsync( IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync) : this(TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, generalAspectAsync, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with retry strategy, 20ms delay, asynchronous general aspect and asynchronous before aspect. /// </summary> /// <param name="retryStrategy"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> protected WithAspectAndRetryAsync( IRetryStrategy retryStrategy, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, null, generalAspectAsync, beforeAsync, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, asynchronous general aspect and asynchronous before aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> protected WithAspectAndErrorHandlerAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(errorHandlerStrategy, null, generalAspectAsync, beforeAsync) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, general aspect and asynchronous general aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> protected WithAspectAndErrorHandlerAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync) : this(errorHandlerStrategy, generalAspect, generalAspectAsync, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, retry strategy, 20ms delay, general aspect and asynchronous general aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> protected WithSagaAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync) : this(errorHandlerStrategy, TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, generalAspectAsync, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, retry strategy, 20ms delay, general aspect, asynchronous general aspect and asynchronous before aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> protected WithSagaAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(errorHandlerStrategy, TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, generalAspectAsync, beforeAsync, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, general aspect, asynchronous general aspect, asynchronous before and after aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> /// <param name="afterAsync"></param> protected WithAspectAndErrorHandlerAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync, IReadOnlyList <IAfterAspectAsync <TInput, TOutput> > afterAsync) : base(generalAspect, generalAspectAsync, beforeAsync, afterAsync) { _errorHandlerStrategy = errorHandlerStrategy ?? throw new ArgumentNullException("Error handler strategy cannot be null."); }
/// <summary> /// Create with general aspect, asynchronous general aspect, asynchronous before and after aspect. /// </summary> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> /// <param name="afterAsync"></param> protected WithAspectAsync( IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync, IReadOnlyList <IAfterAspectAsync <TInput, TOutput> > afterAsync) { _generalAspect = generalAspect; _generalAspectAsync = generalAspectAsync; _beforeAsync = beforeAsync; _afterAsync = afterAsync; }
/// <inheritdoc /> /// <summary> /// Create with delay, retry strategy, general aspect, asynchronous aspect, asynchronous before and after aspect. /// </summary> /// <param name="delay"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> /// <param name="afterAsync"></param> protected WithAspectAndRetryAsync( TimeSpan delay, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync, IReadOnlyList <IAfterAspectAsync <TInput, TOutput> > afterAsync) : base(generalAspect, generalAspectAsync, beforeAsync, afterAsync) { _retryStrategy = retryStrategy; _delayMiliseconds = (int)delay.TotalMilliseconds; }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, delay, retry strategy, general aspect, asynchronous aspect, asynchronous before and after aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="delay"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> /// <param name="afterAsync"></param> protected WithSagaAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, TimeSpan delay, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync, IReadOnlyList <IAfterAspectAsync <TInput, TOutput> > afterAsync) : base(delay, retryStrategy, generalAspect, generalAspectAsync, beforeAsync, afterAsync) { _errorHandlerStrategy = errorHandlerStrategy; }
/// <summary> /// Create with general aspect, asynchronous general aspect and asynchronous before aspect. /// </summary> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> protected WithAspectAsync(IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(generalAspect, generalAspectAsync, beforeAsync, null) { }
/// <summary> /// Create with general aspect and asynchronous general aspect. /// </summary> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> protected WithAspectAsync(IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync) : this(generalAspect, generalAspectAsync, null) { }