Interface ICancellableOperation<T>
Represents a cancelable operation.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Operations
Assembly: BotBrain.Operations.dll
Syntax
public interface ICancellableOperation<T> : IOperation<T>, ICancellableOperation, IOperation
Type Parameters
Name | Description |
---|---|
T | A context to run the operation in. |
Methods
View SourceCancel(T)
Cancels an operations running on a specific item.
Declaration
void Cancel(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item. |
Run(T, CancellationToken)
Runs the operation on an item.
Declaration
Task<bool> Run(T item, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item. |
CancellationToken | token | A token to cancel the operation. |
Returns
Type | Description |
---|---|
Task<bool> | A task that returns a boolean indicating success or failure when the operation completes. |