using Elsa.Workflows;
namespace Elsa.Resilience;
///
/// Provides functionality to execute an activity's logic with a specified resilience strategy, or execute the action directly if no resilience configuration is applicable.
///
public interface IResilientActivityInvoker
{
///
/// Invokes a resilient activity execution with the provided action using the activity's selected resilience strategy configuration.
/// If no resilience configuration is provided or otherwise does not evaluate to a strategy, the action is called as-is.
///
/// The type of the result produced by the activity.
/// The resilient activity being invoked.
/// The execution context in which the activity runs.
/// The action representing the activity's execution logic.
/// A token to monitor for cancellation requests.
/// The result of the invoked action.
Task InvokeAsync(IResilientActivity activity, ActivityExecutionContext context, Func> action, CancellationToken cancellationToken = default);
}