Redigera

Dela via


TransformManyBlock<TInput,TOutput>.ISourceBlock<TOutput>.ConsumeMessage Method

Definition

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

Parameters

messageHeader
DataflowMessageHeader

The DataflowMessageHeader of the message being consumed.

target
ITargetBlock<TOutput>

The ITargetBlock<TInput> consuming the message.

messageConsumed
Boolean

true if the message was successfully consumed; otherwise, false.

Returns

TOutput

The value of the consumed message. This may correspond to a different DataflowMessageHeader instance than was previously reserved and passed as the messageHeader to ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, 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)

If the message requested is not available, the return value will be null.

Implements

Exceptions

The messageHeader is not valid.

The target is null.

Remarks

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.

Applies to