public static class TaskCompletionSourceExtensions
Extension 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 |
TaskCompletionSource The task completion source. Must not be null. |
cancellationToken |
CancellationToken The 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 |