Show / Hide Table of Contents

Struct Awaiter<TAwaiter, TResult>

Represents awaiter pattern for type TAwaiter with non-Void result.

Implements
INotifyCompletion
Inherited Members
ValueType.Equals(Object)
ValueType.GetHashCode()
ValueType.ToString()
Object.Equals(Object, Object)
Object.GetType()
Object.ReferenceEquals(Object, Object)
Namespace: DotNext.Runtime.CompilerServices
Assembly: DotNext.Reflection.dll
Syntax
public struct Awaiter<TAwaiter, TResult> : INotifyCompletion where TAwaiter : INotifyCompletion
Type Parameters
Name Description
TAwaiter

Any type implementing awaiter pattern.

TResult

Type of asynchronous result.

Constructors

| Improve this Doc View Source

Awaiter(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 Source

IsCompleted

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 Source

GetResult()

Ends the wait for the completion of the asynchronous task.

Declaration
public TResult GetResult()
Returns
Type Description
TResult

The result of the completed task.

Exceptions
Type Condition
TaskCanceledException

The task was cancelled.

Exception

Task is in faulted state.

| Improve this Doc View Source

GetResult(TAwaiter)

Ends the wait for the completion of the asynchronous task.

Declaration
public static TResult GetResult(in TAwaiter awaiter)
Parameters
Type Name Description
TAwaiter awaiter

An object that waits for the completion of an asynchronous task.

Returns
Type Description
TResult

The result of the completed task.

Exceptions
Type Condition
TaskCanceledException

The task was cancelled.

Exception

Task is in faulted state.

Operators

| Improve this Doc View Source

Implicit(Awaiter<TAwaiter, TResult> to TAwaiter)

Extracts underlying awaiter object from this wrapper.

Declaration
public static implicit operator TAwaiter(in Awaiter<TAwaiter, TResult> awaiter)
Parameters
Type Name Description
Awaiter<TAwaiter, TResult> awaiter

Generic awaiter object.

Returns
Type Description
TAwaiter

Explicit Interface Implementations

| Improve this Doc View Source

INotifyCompletion.OnCompleted(Action)

Declaration
void INotifyCompletion.OnCompleted(Action continuation)
Parameters
Type Name Description
Action continuation

Implements

System.Runtime.CompilerServices.INotifyCompletion

Extension Methods

Sequence.Skip<TEnumerator, T>(ref TEnumerator, Int32)
ExpressionBuilder.Const<T>(T)

See Also

Task<TResult>
TaskAwaiter<TResult>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX