Struct EvergineConfiguredAwaiter<T>
Provides an awaitable object that allows for configured awaits on Task<TResult>.
Implements
Inherited Members
Namespace: Evergine.Framework.Threading
Assembly: Evergine.Framework.dll
Syntax
public struct EvergineConfiguredAwaiter<T> : INotifyCompletion
Type Parameters
Name | Description |
---|---|
T | The type of Task result. |
Remarks
This type is intended for compiler use only.
Constructors
EvergineConfiguredAwaiter(Task<T>, EvergineTaskContinueOn)
Initializes a new instance of the EvergineConfiguredAwaiter<T> struct.
Declaration
public EvergineConfiguredAwaiter(Task<T> task, EvergineTaskContinueOn continueOn)
Parameters
Type | Name | Description |
---|---|---|
Task<T> | task | The awaitable Task. |
EvergineTaskContinueOn | continueOn | The desired continuation behavior. |
Properties
IsCompleted
Gets a value indicating whether the task being awaited is completed.
Declaration
public bool IsCompleted { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This property is intended for compiler user rather than use directly in code.
Exceptions
Type | Condition |
---|---|
NullReferenceException | The awaiter was not properly initialized. |
Methods
GetAwaiter()
Gets an awaiter for this awaitable.
Declaration
public EvergineConfiguredAwaiter<T> GetAwaiter()
Returns
Type | Description |
---|---|
EvergineConfiguredAwaiter<T> | The awaiter. |
GetResult()
Ends the await on the completed Task<TResult>.
Declaration
public T GetResult()
Returns
Type | Description |
---|---|
T | The result of the completed Task<TResult>. |
Exceptions
Type | Condition |
---|---|
NullReferenceException | The awaiter was not properly initialized. |
TaskCanceledException | The task was canceled. |
Exception | The task completed in a Faulted state. |
OnCompleted(Action)
Schedules the continuation onto the Task associated with this TaskAwaiter.
Declaration
public void OnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
Action | continuation | The action to invoke when the await operation completes. |
Remarks
This method is intended for compiler user rather than use directly in code.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
NullReferenceException | The awaiter was not properly initialized. |