IAsyncCommand Interface

Represents a subcommand that executes asynchronously.

Definition

Namespace: Ookii.CommandLine.Commands
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public interface IAsyncCommand : ICommand
Implements
ICommand

Remarks

This interface adds a RunAsync method to the ICommand interface, that will be invoked by the CommandManagerRunCommandAsync method and its overloads. This allows you to write tasks that use asynchronous code.

Use the AsyncCommandBase class as a base class for your command to get a default implementation of the ICommandRun

If you want to use the cancellation token passed to the CommandManagerRunCommandAsync(CancellationToken) method, you should instead implement the IAsyncCancelableCommand interface, or derive from the AsyncCommandBase class.

Methods

Run Runs the command.
(Inherited from ICommand)
RunAsync Runs the command asynchronously.

See Also