ITargetBlock(Of TInput).OfferMessage Method
Offers a message to the ITargetBlock(Of TInput), giving the target the opportunity to consume or postpone the message.
Assembly: System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)
'Declaration Function OfferMessage ( _ messageHeader As DataflowMessageHeader, _ messageValue As TInput, _ source As ISourceBlock(Of TInput), _ consumeToAccept As Boolean _ ) As DataflowMessageStatus
- Type: System.Threading.Tasks.Dataflow.DataflowMessageHeader
A DataflowMessageHeader instance that represents the header of the message being offered.
- Type: TInput
The value of the message being offered.
- Type: System.Threading.Tasks.Dataflow.ISourceBlock(Of TInput)
The ISourceBlock(Of TOutput) offering the message. This may be Nothing.
Return ValueType: System.Threading.Tasks.Dataflow.DataflowMessageStatus
The status of the offered message. If the message was accepted by the target, Accepted is returned, and the source should no longer use the offered message, because it is now owned by the target. If the message was postponed by the target, Postponed is returned as a notification that the target may later attempt to consume or reserve the message; in the meantime, the source still owns the message and may offer it to other blocks.
If the target would have otherwise postponed message, but source was Nothing, Declined is instead returned.
If the target tried to accept the message but missed it due to the source delivering the message to another target or simply discarding it, NotAvailable is returned.
If the target chose not to accept the message, Declined is returned. If the target chose not to accept the message and will never accept another message from this source, DecliningPermanently is returned.
The messageHeader is not valid.
-or-consumeToAccept may only be true if provided with a non-null source.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.