IDataflowBlock.Completion 属性
定义
public:
property System::Threading::Tasks::Task ^ Completion { System::Threading::Tasks::Task ^ get(); };
public System.Threading.Tasks.Task Completion { get; }
member this.Completion : System.Threading.Tasks.Task
Public ReadOnly Property Completion As Task
属性值
任务。The task.
注解
数据流块在当前未处理消息时,将被视为已完成,并保证其不会再处理其他消息。A dataflow block is considered completed when it is not currently processing a message and when it has guaranteed that it will not process any more messages. Task完成关联的块后,返回的将转换为已完成状态。The returned Task will transition to a completed state when the associated block has completed. TaskStatus RanToCompletion 当块根据数据流块的定义语义成功完成其处理时,它将转换为状态。It will transition to the TaskStatusRanToCompletion state when the block completes its processing successfully according to the dataflow block's defined semantics. TaskStatus Faulted 当数据流块由于未经处理的异常而提前完成处理时,它将转换为状态,并且 TaskStatus Canceled 当数据流块由于接收取消请求而提前处理结束时,它将转换为状态。It will transition to the TaskStatusFaulted state when the dataflow block has completed processing prematurely due to an unhandled exception, and it will transition to the TaskStatusCanceled state when the dataflow block has completed processing prematurely due to receiving a cancellation request. 如果任务在状态中完成 Faulted ,则其 Exception 属性将返回,其中 AggregateException 包含导致块失败的一个或多个异常。If the task completes in the Faulted state, its Exception property will return an AggregateException containing the one or more exceptions that caused the block to fail.