TransformManyBlock<TInput,TOutput>.ISourceBlock<TOutput>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean) Método
Definição
Chamado por um ITargetBlock<TInput> vinculado para aceitar e consumir um DataflowMessageHeader anteriormente oferecido por este ISourceBlock<TOutput>.Called by a linked ITargetBlock<TInput> to accept and consume a DataflowMessageHeader previously offered by this ISourceBlock<TOutput>.
virtual TOutput System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>.ConsumeMessage(System::Threading::Tasks::Dataflow::DataflowMessageHeader messageHeader, System::Threading::Tasks::Dataflow::ITargetBlock<TOutput> ^ target, [Runtime::InteropServices::Out] bool % messageConsumed) = System::Threading::Tasks::Dataflow::ISourceBlock<TOutput>::ConsumeMessage;
TOutput ISourceBlock<TOutput>.ConsumeMessage (System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock<TOutput> target, out bool messageConsumed);
abstract member System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>.ConsumeMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<'Output> * bool -> 'Output
override this.System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>.ConsumeMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<'Output> * bool -> 'Output
Function ConsumeMessage (messageHeader As DataflowMessageHeader, target As ITargetBlock(Of TOutput), ByRef messageConsumed As Boolean) As TOutput Implements ISourceBlock(Of TOutput).ConsumeMessage
Parâmetros
- messageHeader
- DataflowMessageHeader
O DataflowMessageHeader da mensagem que é consumida.The DataflowMessageHeader of the message being consumed.
- target
- ITargetBlock<TOutput>
O ITargetBlock<TInput> que consome a mensagem.The ITargetBlock<TInput> consuming the message.
- messageConsumed
- Boolean
true se a mensagem foi consumida com êxito; caso contrário, false.true if the message was successfully consumed; otherwise, false.
Retornos
- TOutput
O valor da mensagem consumida.The value of the consumed message. Isso pode corresponder a uma instância DataflowMessageHeader diferente que foi reservada anteriormente e passada como o messageHeader para ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean).This may correspond to a different DataflowMessageHeader instance than was previously reserved and passed as the messageHeader to ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean). O ITargetBlock<TInput> de consumo deve usar o valor retornado em vez do valor passado como messageValue por meio de OfferMessage ITargetBlock<TInput>.OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean)The consuming ITargetBlock<TInput> must use the returned value instead of the value passed as messageValue through OfferMessage ITargetBlock<TInput>.OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean)
Se a mensagem solicitada não estiver disponível, o valor retornado será null.If the message requested is not available, the return value will be null.
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 ConsumeMessage , e ela deve ser usada apenas para consumir DataflowMessageHeader instâncias anteriormente oferecidas por essa origem para o destino.Only ITargetBlock<TInput> instances linked to this ISourceBlock<TOutput> instance may use ConsumeMessage, and it must only be used to consume DataflowMessageHeader instances previously offered by this source to the target.