BatchedJoinBlock<T1,T2,T3>.ISourceBlock<Tuple<IList<T1>,IList<T2>,IList<T3>>>.ReserveMessage 方法

定义

保留将 DataflowMessageHeader 标识的消息的所有权从此 ISourceBlock<TOutput> 传递到 ITargetBlock<TInput> 的权限。

 virtual bool System.Threading.Tasks.Dataflow.ISourceBlock<System.Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>,System.Collections.Generic.IList<T3>>>.ReserveMessage(System::Threading::Tasks::Dataflow::DataflowMessageHeader messageHeader, System::Threading::Tasks::Dataflow::ITargetBlock<Tuple<System::Collections::Generic::IList<T1> ^, System::Collections::Generic::IList<T2> ^, System::Collections::Generic::IList<T3> ^> ^> ^ target) = System::Threading::Tasks::Dataflow::ISourceBlock<Tuple<System::Collections::Generic::IList<T1> ^, System::Collections::Generic::IList<T2> ^, System::Collections::Generic::IList<T3> ^> ^>::ReserveMessage;
bool ISourceBlock<Tuple<IList<T1>,IList<T2>,IList<T3>>>.ReserveMessage (System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock<Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>,System.Collections.Generic.IList<T3>>> target);
abstract member System.Threading.Tasks.Dataflow.ISourceBlock<System.Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>,System.Collections.Generic.IList<T3>>>.ReserveMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<System.Collections.Generic.IList<'T1> * System.Collections.Generic.IList<'T2> * System.Collections.Generic.IList<'T3>> -> bool
override this.System.Threading.Tasks.Dataflow.ISourceBlock<System.Tuple<System.Collections.Generic.IList<T1>,System.Collections.Generic.IList<T2>,System.Collections.Generic.IList<T3>>>.ReserveMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<System.Collections.Generic.IList<'T1> * System.Collections.Generic.IList<'T2> * System.Collections.Generic.IList<'T3>> -> bool
Function ReserveMessage (messageHeader As DataflowMessageHeader, target As ITargetBlock(Of Tuple(Of IList(Of T1), IList(Of T2), IList(Of T3)))) As Boolean Implements ISourceBlock(Of Tuple(Of IList(Of T1), IList(Of T2), IList(Of T3))).ReserveMessage

参数

messageHeader
DataflowMessageHeader

要保留的消息的 DataflowMessageHeader

target
ITargetBlock<Tuple<IList<T1>,IList<T2>,IList<T3>>>

要为其保留消息的 ITargetBlock<TInput>

返回

Boolean

如果已成功保留该消息,则为 true;否则,为 false

实现

例外

messageHeader 无效。

targetnull(在 Visual Basic 中为 Nothing)。

注解

ITargetBlock<TInput>要保留的消息不需要从此ISourceBlock<TOutput>实例链接。 此外,此 ISourceBlock<TOutput> 实例可能从未直接向该 ITargetBlock<TInput>实例提供消息。

如果true返回,则必须随后调用同一消息或ReleaseReservation对此消息进行ITargetBlock<TInput>调用ConsumeMessageDataflowMessageHeader。 否则,源可能无法将任何进一步的消息传播到任何目标。

当目标持有任何内部锁时不要调用 ReserveMessage 。 这样做会违反在数据流网络中避免死锁所需的锁层次结构。

适用于