BatchedJoinBlock<T1,T2>.ISourceBlock<Tuple<IList<T1>,IList<T2>>>.ReserveMessage Metoda

Definicja

Zastrzega sobie prawo do przekazania własności wiadomości zidentyfikowanej przez DataflowMessageHeader element z tego ISourceBlock<TOutput> do .ITargetBlock<TInput>

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

Parametry

messageHeader
DataflowMessageHeader

Wiadomość DataflowMessageHeader , która ma być zarezerwowana.

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

Element ITargetBlock<TInput> , dla którego komunikat ma być zarezerwowany.

Zwraca

true jeśli komunikat został pomyślnie zarezerwowany; w przeciwnym razie , false.

Implementuje

Wyjątki

Wartość jest nieprawidłowa messageHeader .

Element target is null (Nothing w Visual Basic).

Uwagi

Element ITargetBlock<TInput> , dla którego komunikat ma być zarezerwowany, nie musi być połączony z tym ISourceBlock<TOutput> wystąpieniem. Ponadto to ISourceBlock<TOutput> wystąpienie mogło nigdy nie oferować komunikatu bezpośrednio do elementu ITargetBlock<TInput>.

Jeśli true zostanie zwrócona, musisz następnie wywołać jedną ConsumeMessage lub ReleaseReservation dla tej wiadomości z tym samym DataflowMessageHeader i ITargetBlock<TInput>. Jeśli tego nie zrobisz, źródło może nie być w stanie rozpropagować dalszych komunikatów do żadnego obiektu docelowego.

Nie należy wywoływać ReserveMessage , gdy element docelowy przechowuje jakiekolwiek blokady wewnętrzne. Spowoduje to naruszenie hierarchii blokady niezbędnej do uniknięcia zakleszczeń w sieci przepływu danych.

Dotyczy