Class NotifyCompletion<TAwaiter>
Represents base concept of awaiter pattern.
Inherited Members
Namespace: DotNext.Runtime.CompilerServices
Assembly: DotNext.Reflection.dll
Syntax
[BeforeFieldInit(false)]
public static class NotifyCompletion<TAwaiter>
where TAwaiter : INotifyCompletion
Type Parameters
Name | Description |
---|---|
TAwaiter | Any type implementing awaiter pattern. |
Remarks
This concept doesn't provide methods to obtain task result.
Methods
| Improve this Doc View SourceIsCompleted(TAwaiter)
Gets a value that indicates whether the asynchronous task has completed.
Declaration
public static bool IsCompleted(in TAwaiter awaiter)
Parameters
Type | Name | Description |
---|---|---|
TAwaiter | awaiter | An object that waits for the completion of an asynchronous task. |
Returns
Type | Description |
---|---|
Boolean | true if the task has completed; otherwise, false. |
OnCompleted(TAwaiter, Action)
Schedules the continuation action that's invoked when the instance completes.
Declaration
public static void OnCompleted(in TAwaiter awaiter, Action continuation)
Parameters
Type | Name | Description |
---|---|---|
TAwaiter | awaiter | An object that waits for the completion of an asynchronous task. |
Action | continuation | The action to invoke when the operation completes. |