ISourceBlock<TOutput>.ConsumeMessage Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called by a linked ITargetBlock<TInput> to accept and consume a DataflowMessageHeader previously offered by this ISourceBlock<TOutput>.
public TOutput ConsumeMessage (System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock<out TOutput> target, out bool messageConsumed);
public TOutput? ConsumeMessage (System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock<out TOutput> target, out bool messageConsumed);
abstract member ConsumeMessage : System.Threading.Tasks.Dataflow.DataflowMessageHeader * System.Threading.Tasks.Dataflow.ITargetBlock<'Output> * bool -> 'Output
Public Function ConsumeMessage (messageHeader As DataflowMessageHeader, target As ITargetBlock(Of Out TOutput), ByRef messageConsumed As Boolean) As TOutput
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
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(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean).
If the message requested is not available, the return value will be null.
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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기