Method ExecuteAsync
- Namespace
- IntentSharp.Targets
- Assembly
- IntentSharp.dll
ExecuteAsync(CommandPlan, CancellationToken)
Checks plan and, when the check passes and a fresh check with data.stage
execute passes too, runs it on the target under the resolved limits. A refused plan returns an outcome
with Executed false; so does a dry run (data.dryRun resolved to true). The plan
is copied once, when the call starts: the target inspects that copy and executes that same copy, so a change made
to the plan's command or parameters during the call never reaches the target. Plan
holds the copy.
public Task<CommandOutcome> ExecuteAsync(CommandPlan plan, CancellationToken cancellationToken = default)
Parameters
planCommandPlanThe plan, typically one a caller reviewed after PlanAsync(string, object?, CancellationToken).
cancellationTokenCancellationTokenCancels the call, the execution included.
Returns
- Task<CommandOutcome>
The outcome.
Exceptions
- ArgumentNullException
planis null.- TargetOperationException
Describing, inspecting or executing failed as the target classified it, or the execution outlasted
data.timeout(Timeout).- OperationCanceledException
cancellationTokenwas cancelled.