Struct Awaiter<TAwaiter>
Represents awaiter pattern for type TAwaiter
.
with Void result.
Implements
Inherited Members
Namespace: DotNext.Runtime.CompilerServices
Assembly: DotNext.Reflection.dll
Syntax
public struct Awaiter<TAwaiter> : INotifyCompletion where TAwaiter : INotifyCompletion
Type Parameters
Name | Description |
---|---|
TAwaiter | Any type implementing awaiter pattern. |
Constructors
| Improve this Doc View SourceAwaiter(TAwaiter)
Initializes a new generic awaiter object.
Declaration
public Awaiter(TAwaiter awaiter)
Parameters
Type | Name | Description |
---|---|---|
TAwaiter | awaiter | Underlying awaiter object. |
Properties
| Improve this Doc View SourceIsCompleted
Gets a value that indicates whether the asynchronous task has completed.
Declaration
public bool IsCompleted { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceGetResult()
Ends the wait for the completion of the asynchronous task.
Declaration
public void GetResult()
Exceptions
Type | Condition |
---|---|
TaskCanceledException | The task was cancelled. |
Exception | Task is in faulted state. |
GetResult(TAwaiter)
Ends the wait for the completion of the asynchronous task.
Declaration
public static void GetResult(in TAwaiter awaiter)
Parameters
Type | Name | Description |
---|---|---|
TAwaiter | awaiter | An object that waits for the completion of an asynchronous task. |
Exceptions
Type | Condition |
---|---|
TaskCanceledException | The task was cancelled. |
Exception | Task is in faulted state. |
Operators
| Improve this Doc View SourceImplicit(Awaiter<TAwaiter> to TAwaiter)
Extracts underlying awaiter object from this wrapper.
Declaration
public static implicit operator TAwaiter(in Awaiter<TAwaiter> awaiter)
Parameters
Type | Name | Description |
---|---|---|
Awaiter<TAwaiter> | awaiter | Generic awaiter object. |
Returns
Type | Description |
---|---|
TAwaiter |
Explicit Interface Implementations
| Improve this Doc View SourceINotifyCompletion.OnCompleted(Action)
Declaration
void INotifyCompletion.OnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
Action | continuation |