Пример #1
0
 /// <summary>
 /// Builds a NoOp <see cref="Policy"/> that will execute without any custom behavior.
 /// </summary>
 /// <returns>The policy instance.</returns>
 public static NoOpPolicy NoOp()
 {
     return(new NoOpPolicy(
                (action, context, cancellationToken) => NoOpEngine.Implementation(
                    (ctx, ct) => { action(ctx, ct); return EmptyStruct.Instance; }, context,
                    cancellationToken)
                ));
 }
Пример #2
0
 /// <summary>
 /// Builds a NoOp <see cref="Policy"/> that will execute without any custom behavior.
 /// </summary>
 /// <typeparam name="TResult">The type of return values this policy will handle.</typeparam>
 /// <returns>The policy instance.</returns>
 public static NoOpPolicy <TResult> NoOp <TResult>()
 {
     return(new NoOpPolicy <TResult>(
                (func, context, cancellationToken) => NoOpEngine.Implementation(
                    func,
                    cancellationToken)
                ));
 }