DataflowBlock::Post<TInput> Method (ITargetBlock<TInput>^, TInput)
Posts an item to the ITargetBlock<TInput>.
Assembly: System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)
public: generic<typename TInput> [ExtensionAttribute] static bool Post( ITargetBlock<TInput>^ target, TInput item )
Parameters
- target
-
Type:
System.Threading.Tasks.Dataflow::ITargetBlock<TInput>^
The target block.
- item
-
Type:
TInput
The item being offered to the target.
Return Value
Type: System::Booleantrue if the item was accepted by the target block; otherwise, false.
Type Parameters
- TInput
Specifies the type of data accepted by the target block.
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 Post<TInput> 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.