Posts an item to the ITargetBlock<TInput>.
Assembly: System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)
Specifies the type of data accepted by the target block.
- Type: System.Threading.Tasks.Dataflow.ITargetBlock<>
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<>. 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<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.
- 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.