Class ThreadContextAwaiter<TResult>
Awaiter preserving the thread context.
Inheritance
System.Object
ThreadContextAwaiter<TResult>
Implements
System.Runtime.CompilerServices.ICriticalNotifyCompletion
System.Runtime.CompilerServices.INotifyCompletion
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Threading.Tasks
Assembly: Kephas.Core.dll
Syntax
public class ThreadContextAwaiter<TResult> : ICriticalNotifyCompletion, INotifyCompletion
Type Parameters
Name | Description |
---|---|
TResult | Type of the result. |
Constructors
| Improve this Doc View SourceThreadContextAwaiter(Task<TResult>)
Initializes a new instance of the ThreadContextAwaiter<TResult> class.
Declaration
public ThreadContextAwaiter(Task<TResult> task)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task<TResult> | task | The task. |
Properties
| Improve this Doc View SourceIsCompleted
Gets a value indicating whether the awaiter is completed.
Declaration
public bool IsCompleted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
| Improve this Doc View SourceGetAwaiter()
Gets this awaiter.
Declaration
public ThreadContextAwaiter<TResult> GetAwaiter()
Returns
Type | Description |
---|---|
ThreadContextAwaiter<TResult> | The awaiter. |
GetResult()
Notifies the awaiter to get the result.
Declaration
public TResult GetResult()
Returns
Type | Description |
---|---|
TResult | The result returned by the task. |
OnCompleted(Action)
Schedules the continuation action that's invoked when the instance completes.
Declaration
public void OnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
System.Action | continuation | The action to invoke when the operation completes. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
UnsafeOnCompleted(Action)
Schedules the continuation action that's invoked when the instance completes.
Declaration
public void UnsafeOnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
System.Action | continuation | The action to invoke when the operation completes. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
Implements
System.Runtime.CompilerServices.ICriticalNotifyCompletion
System.Runtime.CompilerServices.INotifyCompletion