Skip to content

ResponseCompletionSource Methods

A fulfillable promise.

AsValueTask

View source
public ValueTask<Response> AsValueTask()
Returns this instance as a System.Threading.Tasks.ValueTask.

Returns

This instance, as a System.Threading.Tasks.ValueTask.

AsVoidValueTask

View source
public ValueTask AsVoidValueTask()
Returns this instance as a System.Threading.Tasks.ValueTask.

Returns

This instance, as a System.Threading.Tasks.ValueTask.

Complete(Response)

View source
public void Complete(Response value)
Completes this instance with a result.

Parameters

valueResponse
The result value.

GetResult(short)

View source
public Response GetResult(short token)
Gets the result of the System.Threading.Tasks.Sources.IValueTaskSource.

Parameters

tokenshort
An opaque value that was provided to the System.Threading.Tasks.ValueTask constructor.

Returns

The result of the System.Threading.Tasks.Sources.IValueTaskSource.

GetStatus(short)

View source
public ValueTaskSourceStatus GetStatus(short token)
Gets the status of the current operation.

Parameters

tokenshort
Opaque value that was provided to the System.Threading.Tasks.ValueTask's constructor.

Returns

A value that indicates the status of the current operation.

OnCompleted(Action<object>, object, short, ValueTaskSourceOnCompletedFlags)

View source
public void OnCompleted(Action<object> continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags)
Schedules the continuation action for this System.Threading.Tasks.Sources.IValueTaskSource.

Parameters

continuationAction<object>
The continuation to invoke when the operation has completed.
stateobject
The state object to pass to continuation when it's invoked.
tokenshort
An opaque value that was provided to the System.Threading.Tasks.ValueTask constructor.
flagsValueTaskSourceOnCompletedFlags
The flags describing the behavior of the continuation.