WriteOnceBlock<T>.ISourceBlock<T>.ReserveMessage(DataflowMessageHeader, ITargetBlock<T>) Método
Definição
Chamado por um ITargetBlock<TInput> vinculado para reservar um DataflowMessageHeader oferecido anteriormente por este ISourceBlock<TOutput>.Called by a linked ITargetBlock<TInput> to reserve a previously offered DataflowMessageHeader by this ISourceBlock<TOutput>.
virtual bool System.Threading.Tasks.Dataflow.ISourceBlock<T>.ReserveMessage(System::Threading::Tasks::Dataflow::DataflowMessageHeader messageHeader, System::Threading::Tasks::Dataflow::ITargetBlock<T> ^ target) = System::Threading::Tasks::Dataflow::ISourceBlock<T>::ReserveMessage;
bool ISourceBlock<T>.ReserveMessage (System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock<T> target);
abstract member System.Threading.Tasks.Dataflow.ISourceBlock<T>.ReserveMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<'T> -> bool
override this.System.Threading.Tasks.Dataflow.ISourceBlock<T>.ReserveMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<'T> -> bool
Function ReserveMessage (messageHeader As DataflowMessageHeader, target As ITargetBlock(Of T)) As Boolean Implements ISourceBlock(Of T).ReserveMessage
Parâmetros
- messageHeader
- DataflowMessageHeader
O DataflowMessageHeader da mensagem que é reservada.The DataflowMessageHeader of the message being reserved.
- target
- ITargetBlock<T>
O ITargetBlock<TInput> que reserva a mensagem.The ITargetBlock<TInput> reserving the message.
Retornos
true se a mensagem foi reservada com êxito; caso contrário, false.true if the message was successfully reserved; otherwise, false.
Implementações
Exceções
O messageHeader não é válido.The messageHeader is not valid.
O target é null.The target is null.
Comentários
Somente ITargetBlock<TInput> instâncias vinculadas a esta ISourceBlock<TOutput> instância podem usar ReserveMessage , e ela deve ser usada apenas para reservar DataflowMessageHeader instâncias anteriormente oferecidas por essa origem para o destino.Only ITargetBlock<TInput> instances linked to this ISourceBlock<TOutput> instance may use ReserveMessage, and it must only be used to reserve DataflowMessageHeader instances previously offered by this source to the target.
Se true for retornado, o ITargetBlock<TInput> deverá chamar subseqüentemente ConsumeMessage ou ReleaseReservation para essa mensagem.If true is returned, the ITargetBlock<TInput> must subsequently call either ConsumeMessage or ReleaseReservation for this message. Não fazer isso pode resultar na origem de não conseguir propagar nenhuma mensagem adicional para este ou outros destinos.Failure to do so may result in the source being unable to propagate any further messages to this or other targets.
ReserveMessage Não deve ser chamado enquanto o destino estiver mantendo quaisquer bloqueios internos.ReserveMessage must not be called while the target is holding any internal locks. Isso irá violar a hierarquia de bloqueio necessária para evitar deadlocks em uma rede de Dataflow.Doing so will violate the lock hierarchy necessary to avoid deadlocks in a dataflow network.