Table of Contents

Class ResultSink<TResult>

Namespace
Microsoft.AutoGen.Core
Assembly
Microsoft.AutoGen.Core.dll
public sealed class ResultSink<TResult> : IValueTaskSource<TResult>, IValueTaskSource

Type Parameters

TResult
Inheritance
ResultSink<TResult>
Implements
Inherited Members

Properties

Future

public ValueTask<TResult> Future { get; }

Property Value

ValueTask<TResult>

FutureNoResult

public ValueTask FutureNoResult { get; }

Property Value

ValueTask

IsCancelled

public bool IsCancelled { get; }

Property Value

bool

Methods

GetResult(short)

Gets the result of the IValueTaskSource<TResult>.

public TResult GetResult(short token)

Parameters

token short

An opaque value that was provided to the ValueTask constructor.

Returns

TResult

The result of the IValueTaskSource<TResult>.

GetStatus(short)

Gets the status of the current operation.

public ValueTaskSourceStatus GetStatus(short token)

Parameters

token short

Opaque value that was provided to the ValueTask's constructor.

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 object

The state object to pass to continuation when it's invoked.

token short

An opaque value that was provided to the ValueTask constructor.

flags ValueTaskSourceOnCompletedFlags

The flags describing the behavior of the continuation.

SetCancelled(OperationCanceledException?)

public void SetCancelled(OperationCanceledException? ocEx = null)

Parameters

ocEx OperationCanceledException

SetException(Exception)

public void SetException(Exception exception)

Parameters

exception Exception

SetResult(TResult)

public void SetResult(TResult result)

Parameters

result TResult