Beispiel #1
0
 /// <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)
 {
 }
Beispiel #2
0
 /// <summary>
 /// Create with general, before and after aspect.
 /// </summary>
 /// <param name="generalAspect"></param>
 /// <param name="before"></param>
 /// <param name="after"></param>
 protected WithAspect(IGeneralAspect generalAspect, IReadOnlyList <IBeforeAspect <TInput, TOutput> > before,
                      IReadOnlyList <IAfterAspect <TInput, TOutput> > after)
 {
     _generalAspect = generalAspect;
     _before        = before;
     _after         = after;
 }
Beispiel #3
0
 /// <inheritdoc />
 /// <summary>
 /// Create with retry strategy, 20ms delay, general aspect and asynchronous before aspect.
 /// </summary>
 /// <param name="retryStrategy"></param>
 /// <param name="generalAspect"></param>
 /// <param name="beforeAsync"></param>
 protected WithAspectAndRetryAsync(
     IRetryStrategy retryStrategy,
     IGeneralAspect generalAspect,
     IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync)
     : this(TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, null, beforeAsync, null)
 {
 }
Beispiel #4
0
 /// <inheritdoc />
 /// <summary>
 /// Create with retry strategy, delay and general aspect.
 /// </summary>
 /// <param name="retryStrategy"></param>
 /// <param name="delay"></param>
 /// <param name="generalAspect"></param>
 protected WithAspectAndRetryAsync(
     IRetryStrategy retryStrategy,
     int delay,
     IGeneralAspect generalAspect)
     : this(TimeSpan.FromMilliseconds(delay), retryStrategy, generalAspect, null, null, null)
 {
 }
Beispiel #5
0
 /// <inheritdoc />
 /// <summary>
 /// Create with error handler strategy, general aspect and asynchronous before aspect.
 /// </summary>
 /// <param name="errorHandlerStrategy"></param>
 /// <param name="generalAspect"></param>
 /// <param name="beforeAsync"></param>
 protected WithAspectAndErrorHandlerAsync(
     IErrorHandlerStrategyAsync errorHandlerStrategy,
     IGeneralAspect generalAspect,
     IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) :
     this(errorHandlerStrategy, generalAspect, null, beforeAsync, null)
 {
 }
Beispiel #6
0
 /// <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)
 {
 }
Beispiel #7
0
 /// <inheritdoc />
 /// <summary>
 /// Create with error handler strategy, retry strategy, 20ms delay and general aspect.
 /// </summary>
 /// <param name="errorHandlerStrategy"></param>
 /// <param name="retryStrategy"></param>
 /// <param name="generalAspect"></param>
 protected WithSaga(
     IErrorHandlerStrategy errorHandlerStrategy,
     IRetryStrategy retryStrategy,
     IGeneralAspect generalAspect) :
     this(errorHandlerStrategy, TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, null, null)
 {
 }
Beispiel #8
0
 /// <inheritdoc />
 /// <summary>
 /// Create with error handler strategy, retry strategy, delay and general aspect.
 /// </summary>
 /// <param name="errorHandlerStrategy"></param>
 /// <param name="retryStrategy"></param>
 /// <param name="delay"></param>
 /// <param name="generalAspect"></param>
 protected WithSagaAsync(
     IErrorHandlerStrategyAsync errorHandlerStrategy,
     IRetryStrategy retryStrategy,
     int delay,
     IGeneralAspect generalAspect)
     : this(errorHandlerStrategy, TimeSpan.FromMilliseconds(delay), retryStrategy, generalAspect, null, null, null)
 {
 }
Beispiel #9
0
 /// <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)
 {
 }
Beispiel #10
0
 /// <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.");
 }
Beispiel #11
0
 /// <inheritdoc />
 /// <summary>
 /// Create with error handler strategy, delay, retry strategy, general, before and after aspect.
 /// </summary>
 /// <param name="errorHandlerStrategy"></param>
 /// <param name="delay"></param>
 /// <param name="retryStrategy"></param>
 /// <param name="generalAspect"></param>
 /// <param name="before"></param>
 /// <param name="after"></param>
 protected WithSaga(
     IErrorHandlerStrategy errorHandlerStrategy,
     TimeSpan delay,
     IRetryStrategy retryStrategy,
     IGeneralAspect generalAspect,
     IReadOnlyList <IBeforeAspect <TInput, TOutput> > before,
     IReadOnlyList <IAfterAspect <TInput, TOutput> > after) :
     base(delay, retryStrategy, generalAspect, before, after)
 {
     _errorHandlerStrategy = errorHandlerStrategy;
 }
Beispiel #12
0
 /// <inheritdoc />
 /// <summary>
 /// Create with delay, retry strategy, general, before and after aspect.
 /// </summary>
 /// <param name="delay"></param>
 /// <param name="retryStrategy"></param>
 /// <param name="generalAspect"></param>
 /// <param name="before"></param>
 /// <param name="after"></param>
 protected WithAspectAndRetry(
     TimeSpan delay,
     IRetryStrategy retryStrategy,
     IGeneralAspect generalAspect,
     IReadOnlyList <IBeforeAspect <TInput, TOutput> > before,
     IReadOnlyList <IAfterAspect <TInput, TOutput> > after) :
     base(generalAspect, before, after)
 {
     _retryStrategy    = retryStrategy;
     _delayMiliseconds = (int)delay.TotalMilliseconds;
 }
Beispiel #13
0
 /// <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;
 }
Beispiel #14
0
 /// <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;
 }
Beispiel #15
0
 /// <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)
 {
 }
Beispiel #16
0
 /// <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)
 {
 }
Beispiel #17
0
 /// <inheritdoc />
 /// <summary>
 /// Create with general aspect.
 /// </summary>
 /// <param name="generalAspect"></param>
 protected WithAspect(IGeneralAspect generalAspect) : this(generalAspect, null, null)
 {
 }
 /// <inheritdoc />
 /// <summary>
 /// Create with error handler strategy and general aspect.
 /// </summary>
 /// <param name="errorHandlerStrategy"></param>
 /// <param name="generalAspect"></param>
 protected WithAspectAndErrorHandler(IErrorHandlerStrategy errorHandlerStrategy, IGeneralAspect generalAspect) :
     this(errorHandlerStrategy, generalAspect, null, null)
 {
 }