IResilienceExecutor
public interface IResilienceExecutorDefines the primary resilience execution facade for the EricksonLopez ecosystem.
Application services and handlers inject this abstraction to execute operations under declared, named resilience policies without depending directly on concrete execution engines or infrastructure implementations.
Miembros (4)
- methodExecuteAsync
ValueTask ExecuteAsync(string policyName, Func<CancellationToken, ValueTask> operation, CancellationToken cancellationToken = default)Executes an asynchronous action without a return value under the specified resilience policy.
- policyName: string
- The name of the registered resilience policy to apply.
- operation: Func<CancellationToken, ValueTask>
- The asynchronous action accepting a cancellation token.
- cancellationToken: CancellationToken
- A token that can be used to cancel the asynchronous operation.
Retorna: A value task representing the asynchronous operation.
Exceptions: Exceptions.CircuitBrokenException: The circuit breaker rejected the operation because the circuit is open; Exceptions.ResilienceTimeoutException: The operation timed out according to the configured timeout limit; Exceptions.RateLimitRejectedException: The rate limiter rejected the operation due to limit exhaustion; Exceptions.ResiliencePolicyNotFoundException: No policy was registered under the specified `policyName`; ArgumentNullException: `operation` is `null`; ArgumentException: `policyName` is `null` or whitespace
- methodExecuteAsync
ValueTask ExecuteAsync(string policyName, Func<ResilienceContext, ValueTask> operation, ResilienceContext context, CancellationToken cancellationToken = default)Executes an asynchronous action without a return value under the specified resilience policy using an explicit context.
- policyName: string
- The name of the registered resilience policy to apply.
- operation: Func<ResilienceContext, ValueTask>
- The asynchronous action accepting the execution context.
- context: ResilienceContext
- The resilience context containing metadata and telemetry context.
- cancellationToken: CancellationToken
- A token that can be used to cancel the asynchronous operation.
Retorna: A value task representing the asynchronous operation.
Exceptions: Exceptions.CircuitBrokenException: The circuit breaker rejected the operation because the circuit is open; Exceptions.ResilienceTimeoutException: The operation timed out according to the configured timeout limit; Exceptions.RateLimitRejectedException: The rate limiter rejected the operation due to limit exhaustion; Exceptions.ResiliencePolicyNotFoundException: No policy was registered under the specified `policyName`; ArgumentNullException: `operation` or `context` is `null`; ArgumentException: `policyName` is `null` or whitespace
- methodExecuteAsync<TResult>
ValueTask<TResult> ExecuteAsync<TResult>(string policyName, Func<CancellationToken, ValueTask<TResult>> operation, CancellationToken cancellationToken = default)Executes an asynchronous operation that yields a value under the specified resilience policy.
- policyName: string
- The name of the registered resilience policy to apply.
- operation: Func<CancellationToken, ValueTask<TResult>>
- The asynchronous operation accepting a cancellation token.
- cancellationToken: CancellationToken
- A token that can be used to cancel the asynchronous operation.
Retorna: A value task representing the asynchronous operation. The task result contains the value produced by `operation`.
Type parameters: TResult: The return type of the operation. Exceptions: Exceptions.CircuitBrokenException: The circuit breaker rejected the operation because the circuit is open; Exceptions.ResilienceTimeoutException: The operation timed out according to the configured timeout limit; Exceptions.RateLimitRejectedException: The rate limiter rejected the operation due to limit exhaustion; Exceptions.ResiliencePolicyNotFoundException: No policy was registered under the specified `policyName`; ArgumentNullException: `operation` is `null`; ArgumentException: `policyName` is `null` or whitespace
- methodExecuteAsync<TResult>
ValueTask<TResult> ExecuteAsync<TResult>(string policyName, Func<ResilienceContext, ValueTask<TResult>> operation, ResilienceContext context, CancellationToken cancellationToken = default)Executes an asynchronous operation that yields a value under the specified resilience policy using an explicit context.
- policyName: string
- The name of the registered resilience policy to apply.
- operation: Func<ResilienceContext, ValueTask<TResult>>
- The asynchronous operation accepting the execution context.
- context: ResilienceContext
- The resilience context containing metadata and telemetry context.
- cancellationToken: CancellationToken
- A token that can be used to cancel the asynchronous operation.
Retorna: A value task representing the asynchronous operation. The task result contains the value produced by `operation`.
Type parameters: TResult: The return type of the operation. Exceptions: Exceptions.CircuitBrokenException: The circuit breaker rejected the operation because the circuit is open; Exceptions.ResilienceTimeoutException: The operation timed out according to the configured timeout limit; Exceptions.RateLimitRejectedException: The rate limiter rejected the operation due to limit exhaustion; Exceptions.ResiliencePolicyNotFoundException: No policy was registered under the specified `policyName`; ArgumentNullException: `operation` or `context` is `null`; ArgumentException: `policyName` is `null` or whitespace