TaskCompletionSource<TResult> class

Represents the producer side of a task unbound to a delegate, providing access to the consumer side through the Task property.

public class TaskCompletionSource<TResult>
parameter description
TResult The type of the result value assocatied with this task completion source.

Public Members

name description
virtual Task { get; } Gets the task created by this task completion source.
virtual SetCanceled() Transitions the underlying task into the Canceled state.
virtual SetException(…) Transitions the underlying task into the Faulted state and binds it to the specified exception.
virtual SetResult(…) Transitions the underlying task into the RanToCompletion state.
virtual TrySetCanceled() Attempts to transition the underlying task into the Canceled state.
virtual TrySetException(…) Attempts to transition the underlying task into the Faulted state and binds it to the specified exception.
virtual TrySetResult(…) Attempts to transition the underlying task into the RanToCompletion state.

See Also