BatchedJoinBlock<T1,T2>.ISourceBlock<Tuple<IList<T1>,IList<T2>>>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<Tuple<IList<T1>,IList<T2>>>, Boolean) 方法
定义
将 DataflowMessageHeader 标识的消息的所有权从此 ISourceBlock<TOutput> 实例传递到 ITargetBlock<TInput>。Passes the ownership of the message identified by the DataflowMessageHeader from this ISourceBlock<TOutput> instance to the ITargetBlock<TInput>.
virtual Tuple<System::Collections::Generic::IList<T1> ^, System::Collections::Generic::IList<T2> ^> ^ System.Threading.Tasks.Dataflow.ISourceBlock<System.Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>>>.ConsumeMessage(System::Threading::Tasks::Dataflow::DataflowMessageHeader messageHeader, System::Threading::Tasks::Dataflow::ITargetBlock<Tuple<System::Collections::Generic::IList<T1> ^, System::Collections::Generic::IList<T2> ^> ^> ^ target, [Runtime::InteropServices::Out] bool % messageConsumed) = System::Threading::Tasks::Dataflow::ISourceBlock<Tuple<System::Collections::Generic::IList<T1> ^, System::Collections::Generic::IList<T2> ^> ^>::ConsumeMessage;
Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>> ISourceBlock<Tuple<IList<T1>,IList<T2>>>.ConsumeMessage (System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock<Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>>> target, out bool messageConsumed);
abstract member System.Threading.Tasks.Dataflow.ISourceBlock<System.Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>>>.ConsumeMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<System.Collections.Generic.IList<'T1> * System.Collections.Generic.IList<'T2>> * bool -> System.Collections.Generic.IList<'T1> * System.Collections.Generic.IList<'T2>
override this.System.Threading.Tasks.Dataflow.ISourceBlock<System.Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>>>.ConsumeMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<System.Collections.Generic.IList<'T1> * System.Collections.Generic.IList<'T2>> * bool -> System.Collections.Generic.IList<'T1> * System.Collections.Generic.IList<'T2>
Function ConsumeMessage (messageHeader As DataflowMessageHeader, target As ITargetBlock(Of Tuple(Of IList(Of T1), IList(Of T2))), ByRef messageConsumed As Boolean) As Tuple(Of IList(Of T1), IList(Of T2)) Implements ISourceBlock(Of Tuple(Of IList(Of T1), IList(Of T2))).ConsumeMessage
参数
- messageHeader
- DataflowMessageHeader
要使用的消息的 DataflowMessageHeader。The DataflowMessageHeader of the message that is to be consumed.
- target
- ITargetBlock<Tuple<IList<T1>,IList<T2>>>
要为其使用消息的 ITargetBlock<TInput>。The ITargetBlock<TInput> for which the message is to be consumed.
- messageConsumed
- Boolean
如果成功使用消息,则为 true。true if the message was successfully consumed. 否则为 false。false otherwise.
返回
所使用的消息的值。The value of the consumed message. 这可能对应于一个 DataflowMessageHeader 实例,该实例不同于之前保留并作为 messageHeader 传递给此方法的实例。This may correspond to a different DataflowMessageHeader instance than was previously reserved and passed as the messageHeader to this method. 使用的 ITargetBlock<TInput> 必须使用返回值而不是作为 messageValue 传递到 OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean) 的值。The consuming ITargetBlock<TInput> must use the returned value instead of the value passed as messageValue to OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean). 如果所请求的消息不可用,则返回值将是 null(在 Visual Basic 中为 Nothing)。If the message requested is not available, the return value is null (Nothing in Visual Basic).
实现
例外
messageHeader 无效。The messageHeader is not valid.
target 为 null(在 Visual Basic 中为 Nothing)。The target is null (Nothing in Visual Basic).
注解
ITargetBlock<TInput>要使用消息的必须与此实例相关联 ISourceBlock<TOutput> 。The ITargetBlock<TInput> for which the message is to be consumed need not be linked from this ISourceBlock<TOutput> instance. 此外,此 ISourceBlock<TOutput> 实例可能从未直接向提供消息 ITargetBlock<TInput> 。Moreover, this ISourceBlock<TOutput> instance may have never offered the message directly to the ITargetBlock<TInput>.