Class ResultSink<TResult>
public sealed class ResultSink<TResult> : IValueTaskSource<TResult>, IValueTaskSource
Type Parameters
TResult
- Inheritance
-
ResultSink<TResult>
- Implements
-
IValueTaskSource<TResult>
- Inherited Members
Properties
Future
public ValueTask<TResult> Future { get; }
Property Value
- ValueTask<TResult>
FutureNoResult
public ValueTask FutureNoResult { get; }
Property Value
IsCancelled
public bool IsCancelled { get; }
Property Value
Methods
GetResult(short)
Gets the result of the IValueTaskSource<TResult>.
public TResult GetResult(short token)
Parameters
Returns
- TResult
The result of the IValueTaskSource<TResult>.
GetStatus(short)
Gets the status of the current operation.
public ValueTaskSourceStatus GetStatus(short token)
Parameters
Returns
- ValueTaskSourceStatus
A value that indicates the status of the current operation.
OnCompleted(Action<object?>, object?, short, ValueTaskSourceOnCompletedFlags)
Schedules the continuation action for this IValueTaskSource<TResult>.
public void OnCompleted(Action<object?> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags)
Parameters
continuation
Action<object>The continuation to invoke when the operation has completed.
state
objectThe state object to pass to
continuation
when it's invoked.token
shortAn opaque value that was provided to the ValueTask constructor.
flags
ValueTaskSourceOnCompletedFlagsThe flags describing the behavior of the continuation.
SetCancelled(OperationCanceledException?)
public void SetCancelled(OperationCanceledException? ocEx = null)
Parameters
SetException(Exception)
public void SetException(Exception exception)
Parameters
exception
Exception
SetResult(TResult)
public void SetResult(TResult result)
Parameters
result
TResult