class TaskCompletionSource<TResult>
in global :: System . Threading . Tasks
Represents the producer side of a unbound to a delegate, providing access to the consumer side through the property.
TResultThe type of the result value associated with this .
public TaskCompletionSource<TResult>( object state )
Creates a with the specified state.
stateThe state to use as the underlying 's AsyncState.
public TaskCompletionSource<TResult>( object state, TaskCreationOptions creationOptions )
Creates a with the specified state and options.
stateThe state to use as the underlying 's AsyncState.creationOptionsThe options to use when creating the underlying .
public TaskCompletionSource<TResult>( TaskCreationOptions creationOptions )
Creates a with the specified options.
creationOptionsThe options to use when creating the underlying .
public void SetException( Exception exception )
Transitions the underlying into the state and binds it to a specified exception.
exceptionThe exception to bind to this .
public Task<TResult> Task { get; }
Gets the created by this .
- Returns Returns the created by this .
public bool TrySetCanceled( CancellationToken cancellationToken )
Attempts to transition the underlying into the state and enables a cancellation token to be stored in the canceled task.
cancellationTokenA cancellation token.- Returns if the operation is successful; otherwise, .
public bool TrySetException( Exception exception )
Attempts to transition the underlying into the state and binds it to a specified exception.
exceptionThe exception to bind to this .- Returns True if the operation was successful; otherwise, false.
public void SetResult( TResult result )
😔 No documentation found.
public bool TrySetResult( TResult result )
😔 No documentation found.
public void SetCanceled( )
😔 No documentation found.
public void SetCanceled( CancellationToken cancellationToken )
😔 No documentation found.
public bool TrySetCanceled( )
😔 No documentation found.
public void SetFromTask( Task<TResult> completedTask )
😔 No documentation found.
public bool TrySetFromTask( Task<TResult> completedTask )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public TaskCompletionSource<TResult>( )
😔 No documentation found.
public void SetException( IEnumerable<Exception> exceptions )
😔 No documentation found.
public bool TrySetException( IEnumerable<Exception> exceptions )
😔 No documentation found.