C# Class AsyncDolls.TaskCompletionSource

Represents the producer side of a System.Threading.Tasks.Task unbound to a delegate, providing access to the consumer side through the Task property.
Afficher le fichier Open project: danielmarbach/async-dolls Class Usage Examples

Méthodes publiques

Méthode Description
SetCanceled ( ) : void

Transitions the underlying Task into the TaskStatus.Canceled state.

SetException ( Exception exception ) : void

Transitions the underlying Task into the TaskStatus.Faulted state.

SetException ( IEnumerable exceptions ) : void

Transitions the underlying Task into the TaskStatus.Faulted state.

SetResult ( ) : void

Transitions the underlying Task into the TaskStatus.RanToCompletion state.

TaskCompletionSource ( ) : System

Initializes a new instance of the TaskCompletionSource class.

TaskCompletionSource ( TaskCreationOptions creationOptions ) : System

Initializes a new instance of the TaskCompletionSource class with the specified options.

TaskCompletionSource ( object state ) : System

Initializes a new instance of the TaskCompletionSource class with the specified state.

TaskCompletionSource ( object state, TaskCreationOptions creationOptions ) : System

Initializes a new instance of the TaskCompletionSource class with the specified state and options.

TrySetCanceled ( ) : bool

Attempts to transition the underlying Task into the TaskStatus.Canceled state.

TrySetException ( Exception exception ) : bool

Attempts to transition the underlying Task into the TaskStatus.Faulted state.

TrySetException ( IEnumerable exceptions ) : bool

Attempts to transition the underlying Task into the TaskStatus.Faulted state.

TrySetResult ( ) : bool

Attempts to transition the underlying Task into the TaskStatus.RanToCompletion state.

Method Details

SetCanceled() public méthode

Transitions the underlying Task into the TaskStatus.Canceled state.
The underlying has already been completed.
public SetCanceled ( ) : void
Résultat void

SetException() public méthode

Transitions the underlying Task into the TaskStatus.Faulted state.
The underlying has already been completed.
public SetException ( Exception exception ) : void
exception System.Exception The exception to bind to this . May not be null.
Résultat void

SetException() public méthode

Transitions the underlying Task into the TaskStatus.Faulted state.
The underlying has already been completed.
public SetException ( IEnumerable exceptions ) : void
exceptions IEnumerable The collection of exceptions to bind to this . May not be null or contain null elements.
Résultat void

SetResult() public méthode

Transitions the underlying Task into the TaskStatus.RanToCompletion state.
The underlying has already been completed.
public SetResult ( ) : void
Résultat void

TaskCompletionSource() public méthode

Initializes a new instance of the TaskCompletionSource class.
public TaskCompletionSource ( ) : System
Résultat System

TaskCompletionSource() public méthode

Initializes a new instance of the TaskCompletionSource class with the specified options.
public TaskCompletionSource ( TaskCreationOptions creationOptions ) : System
creationOptions TaskCreationOptions The options to use when creating the underlying .
Résultat System

TaskCompletionSource() public méthode

Initializes a new instance of the TaskCompletionSource class with the specified state.
public TaskCompletionSource ( object state ) : System
state object The state to use as the underlying 's .
Résultat System

TaskCompletionSource() public méthode

Initializes a new instance of the TaskCompletionSource class with the specified state and options.
public TaskCompletionSource ( object state, TaskCreationOptions creationOptions ) : System
state object The state to use as the underlying 's .
creationOptions TaskCreationOptions The options to use when creating the underlying .
Résultat System

TrySetCanceled() public méthode

Attempts to transition the underlying Task into the TaskStatus.Canceled state.
public TrySetCanceled ( ) : bool
Résultat bool

TrySetException() public méthode

Attempts to transition the underlying Task into the TaskStatus.Faulted state.
public TrySetException ( Exception exception ) : bool
exception System.Exception The exception to bind to this . May not be null.
Résultat bool

TrySetException() public méthode

Attempts to transition the underlying Task into the TaskStatus.Faulted state.
public TrySetException ( IEnumerable exceptions ) : bool
exceptions IEnumerable The collection of exceptions to bind to this . May not be null or contain null elements.
Résultat bool

TrySetResult() public méthode

Attempts to transition the underlying Task into the TaskStatus.RanToCompletion state.
public TrySetResult ( ) : bool
Résultat bool