DataflowBlock.Post(Of TInput) Method
Posts an item to the ITargetBlock(Of TInput).
Assembly: System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)
'Declaration <ExtensionAttribute> _ Public Shared Function Post(Of TInput) ( _ target As ITargetBlock(Of TInput), _ item As TInput _ ) As Boolean
Specifies the type of data accepted by the target block.
- Type: System.Threading.Tasks.Dataflow.ITargetBlock(Of )
The target block.
The item being offered to the target.
Return ValueType: System.Boolean
true if the item was accepted by the target block; otherwise, false.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type ITargetBlock(Of ). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
This method will return once the target block has decided to accept or decline the item, but unless otherwise dictated by special semantics of the target block, it does not wait for the item to actually be processed. For example, ActionBlock(Of TInput) will return from as soon as it has stored the posted item into its input queue). From the perspective of the block's processing, Post is asynchronous. For target blocks that support postponing offered messages, or for blocks that may do more processing in their Post implementation, consider using SendAsync, which will return immediately and will enable the target to postpone the posted message and later consume it after SendAsync returns.