JoinBlock<T1, T2>::ISourceBlock<Tuple<T1, T2>^>::ConsumeMessage Method (DataflowMessageHeader, ITargetBlock<Tuple<T1, T2>^>^, Boolean)
Called by a linked ITargetBlock<TInput> to accept and consume a DataflowMessageHeader previously offered by this ISourceBlock<TOutput>.
Assembly: System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)
private: virtual Tuple<T1, T2>^ ConsumeMessage( DataflowMessageHeader messageHeader, ITargetBlock<Tuple<T1, T2>^>^ target, [OutAttribute] bool% messageConsumed ) sealed = ISourceBlock<Tuple<T1, T2>^>::ConsumeMessage
Parameters
- messageHeader
-
Type:
System.Threading.Tasks.Dataflow::DataflowMessageHeader
The DataflowMessageHeader of the message being consumed.
- target
-
Type:
System.Threading.Tasks.Dataflow::ITargetBlock<Tuple<T1, T2>^>^
The ITargetBlock<TInput> consuming the message.
- messageConsumed
-
Type:
System::Boolean
true if the message was successfully consumed; otherwise, false.
Return Value
Type: System::Tuple<T1, T2>^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. The consuming ITargetBlock<TInput> must use the returned value instead of the value passed as messageValue through OfferMessage.
If the message requested is not available, the return value will be null.
| Exception | Condition |
|---|---|
| ArgumentException | The messageHeader is not valid. |
| ArgumentNullException | The target is null. |
Only ITargetBlock<TInput> instances linked to this ISourceBlock<TOutput> instance may use M:System.Threading.Tasks.Dataflow.ISourceBlock`1.ConsumeMessage(), and it must only be used to consume DataflowMessageHeader instances previously offered by this source to the target.