示例#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)
 {
 }
示例#2
0
 /// <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)
 {
 }
示例#3
0
 /// <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)
 {
 }
示例#4
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)
 {
 }
示例#5
0
 /// <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)
 {
 }
示例#6
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)
 {
 }
示例#7
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.");
 }
示例#8
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;
 }
示例#9
0
 /// <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;
 }
示例#10
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;
 }
示例#11
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)
 {
 }
示例#12
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)
 {
 }