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.

  • TResult The type of the result value associated with this .

public TaskCompletionSource<TResult>( object state )

Creates a with the specified state.

  • state The state to use as the underlying 's AsyncState.

public TaskCompletionSource<TResult>( object state, TaskCreationOptions creationOptions )

Creates a with the specified state and options.

  • state The state to use as the underlying 's AsyncState.
  • creationOptions The options to use when creating the underlying .

public TaskCompletionSource<TResult>( TaskCreationOptions creationOptions )

Creates a with the specified options.

  • creationOptions The 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.

  • exception The 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.

  • cancellationToken A 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.

  • exception The 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.