| TaskExtensionsWithCancellation Method |
Returns the task which completes with result of original task if cancellation token not canceled it before completion.
Namespace:
Akka.Util.Internal
Assembly:
Akka (in Akka.dll) Version: 1.2.3.42 (1.2.3.42)
Syntax public static Task WithCancellation(
this Task task,
CancellationToken cancellationToken
)
[<ExtensionAttribute>]
static member WithCancellation :
task : Task *
cancellationToken : CancellationToken -> Task
Parameters
- task
- Type: System.Threading.TasksTask
The original task. - cancellationToken
- Type: System.ThreadingCancellationToken
The cancellation token.
Return Value
Type:
TaskThe task which completes with result of original task or with cancelled state.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Task. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also