public static class TaskCompletionSourceExtensionsExtension methods for TaskCompletionSource<TResult>.
Namespace
Google.Api.GaxAssembly
Google.Api.Gax.dll
Methods
WithCancellationToken<TResult>(TaskCompletionSource<TResult>, CancellationToken)
public static Task<TResult> WithCancellationToken<TResult>(this TaskCompletionSource<TResult> source, CancellationToken cancellationToken)Returns a task from a task completion source, but observing a given cancellation token.
| Parameters | |
|---|---|
| Name | Description |
source |
TaskCompletionSourceThe task completion source. Must not be null. |
cancellationToken |
CancellationTokenThe cancellation token to observe. |
| Returns | |
|---|---|
| Type | Description |
Task |
A task that will complete when |
| Type Parameter | |
|---|---|
| Name | Description |
TResult |
The result type of the task completion source |