DataflowBlock.Post<TInput>(ITargetBlock<TInput>, TInput) Method
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.
Posts an item to the ITargetBlock<TInput>.
public:
generic <typename TInput>
[System::Runtime::CompilerServices::Extension]
static bool Post(System::Threading::Tasks::Dataflow::ITargetBlock<TInput> ^ target, TInput item);
public static bool Post<TInput>(this System.Threading.Tasks.Dataflow.ITargetBlock<TInput> target, TInput item);
static member Post : System.Threading.Tasks.Dataflow.ITargetBlock<'Input> * 'Input -> bool
<Extension()>
Public Function Post(Of TInput) (target As ITargetBlock(Of TInput), item As TInput) As Boolean
- TInput
Specifies the type of data accepted by the target block.
- target
- ITargetBlock<TInput>
The target block.
- item
- TInput
The item being offered to the target.
true
if the item was accepted by the target block; otherwise, false
.
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 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.
Продукт | Версии |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
UWP | 10.0 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: