Documentation
Table of Contents

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

plan CommandPlan

The plan, typically one a caller reviewed after PlanAsync(string, object?, CancellationToken).

cancellationToken CancellationToken

Cancels the call, the execution included.

Returns

Task<CommandOutcome>

The outcome.

Exceptions

ArgumentNullException

plan is null.

TargetOperationException

Describing, inspecting or executing failed as the target classified it, or the execution outlasted data.timeout (Timeout).

OperationCanceledException

cancellationToken was cancelled.