Click or drag to resize
Akka.NETTaskExtensionsWithCancellation 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.129 (1.2.3.129)
Syntax
public static Task WithCancellation(
	this Task task,
	CancellationToken cancellationToken
)

Parameters

task
Type: System.Threading.TasksTask
The original task.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: Task
The 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