Szerkesztés

Megosztás a következőn keresztül:


ITargetBlock<TInput> Interface

Definition

Represents a dataflow block that is a target for data.

generic <typename TInput>
public interface class ITargetBlock : System::Threading::Tasks::Dataflow::IDataflowBlock
public interface ITargetBlock<in TInput> : System.Threading.Tasks.Dataflow.IDataflowBlock
type ITargetBlock<'Input> = interface
    interface IDataflowBlock
Public Interface ITargetBlock(Of In TInput)
Implements IDataflowBlock

Type Parameters

TInput

Specifies the type of data accepted by the ITargetBlock<TInput>.

This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
Derived
Implements

Remarks

Note

The TPL Dataflow Library (the System.Threading.Tasks.Dataflow namespace) is not distributed with .NET. To install the System.Threading.Tasks.Dataflow namespace in Visual Studio, open your project, choose Manage NuGet Packages from the Project menu, and search online for the System.Threading.Tasks.Dataflow package. Alternatively, to install it using the .NET Core CLI, run dotnet add package System.Threading.Tasks.Dataflow.

Properties

Completion

Gets a Task that represents the asynchronous operation and completion of the dataflow block.

(Inherited from IDataflowBlock)

Methods

Complete()

Signals to the IDataflowBlock that it should not accept nor produce any more messages nor consume any more postponed messages.

(Inherited from IDataflowBlock)
Fault(Exception)

Causes the IDataflowBlock to complete in a Faulted state.

(Inherited from IDataflowBlock)
OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean)

Offers a message to the ITargetBlock<TInput>, giving the target the opportunity to consume or postpone the message.

Extension Methods

AsObserver<TInput>(ITargetBlock<TInput>)

Creates a new IObserver<T> abstraction over the ITargetBlock<TInput>.

Post<TInput>(ITargetBlock<TInput>, TInput)

Posts an item to the ITargetBlock<TInput>.

SendAsync<TInput>(ITargetBlock<TInput>, TInput)

Asynchronously offers a message to the target message block, allowing for postponement.

SendAsync<TInput>(ITargetBlock<TInput>, TInput, CancellationToken)

Asynchronously offers a message to the target message block, allowing for postponement.

Applies to