ValueTaskSourceOnCompletedFlags ValueTaskSourceOnCompletedFlags ValueTaskSourceOnCompletedFlags ValueTaskSourceOnCompletedFlags Enum

定义

提供从 ValueTaskValueTask<TResult> 传递到 OnCompleted 方法的标志,以控制延续行为。Provides flags passed from ValueTask and ValueTask<TResult> to the OnCompleted method to control the behavior of a continuation.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class ValueTaskSourceOnCompletedFlags
[System.Flags]
public enum ValueTaskSourceOnCompletedFlags
type ValueTaskSourceOnCompletedFlags = 
Public Enum ValueTaskSourceOnCompletedFlags
继承
ValueTaskSourceOnCompletedFlagsValueTaskSourceOnCompletedFlagsValueTaskSourceOnCompletedFlagsValueTaskSourceOnCompletedFlags
属性

字段

FlowExecutionContext FlowExecutionContext FlowExecutionContext FlowExecutionContext 2

OnCompleted 应捕获当前 ExecutionContext 并用它来运行延续。OnCompleted should capture the current ExecutionContext and use it to run the continuation.

None None None None 0

对延续的调用方式内有任何要求。No requirements are placed on how the continuation is invoked.

UseSchedulingContext UseSchedulingContext UseSchedulingContext UseSchedulingContext 1

OnCompleted 应该捕获当前调度上下文(SynchronizationContext),并在将延续加入执行队列时使用。OnCompleted should capture the current scheduling context (the SynchronizationContext) and use it when queueing the continuation for execution. 如果未设置此标志,实现可以选择执行任意位置的延续。If this glag is not set, the implementation may choose to execute the continuation in an arbitrary location.

注解

此值将ValueTask从传递OnCompletedSystem.Threading.Tasks.ValueTask<TResult>方法, 从IValueTaskSource<TResult>.OnCompleted传递到方法。This value is passed from a ValueTask to the OnCompleted method, and from a System.Threading.Tasks.ValueTask<TResult> to the IValueTaskSource<TResult>.OnCompleted method.

适用于