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
continuationAction<object>The continuation to invoke when the operation has completed.
stateobjectThe state object to pass to
continuationwhen it's invoked.tokenshortAn opaque value that was provided to the ValueTask constructor.
flagsValueTaskSourceOnCompletedFlagsThe flags describing the behavior of the continuation.
SetCancelled(OperationCanceledException?)
public void SetCancelled(OperationCanceledException? ocEx = null)
Parameters
SetException(Exception)
public void SetException(Exception exception)
Parameters
exceptionException
SetResult(TResult)
public void SetResult(TResult result)
Parameters
resultTResult