DataflowBlock.LinkTo Method

Definition

Overloads

LinkTo<TOutput>(ISourceBlock<TOutput>, ITargetBlock<TOutput>)

Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs

Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput>.

C#
public static IDisposable LinkTo<TOutput>(this System.Threading.Tasks.Dataflow.ISourceBlock<TOutput> source, System.Threading.Tasks.Dataflow.ITargetBlock<TOutput> target);

Type Parameters

TOutput

Specifies the type of data contained in the source.

Parameters

source
ISourceBlock<TOutput>

The source from which to link.

target
ITargetBlock<TOutput>

The ITargetBlock<TInput> to which to connect the source.

Returns

An IDisposable that, upon calling Dispose, will unlink the source from the target.

Exceptions

The source is null.

-or-

The target is null.

Applies to

.NET 10 and other versions
Product Versions
.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

LinkTo<TOutput>(ISourceBlock<TOutput>, ITargetBlock<TOutput>, Predicate<TOutput>)

Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs

Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> using the specified filter.

C#
public static IDisposable LinkTo<TOutput>(this System.Threading.Tasks.Dataflow.ISourceBlock<TOutput> source, System.Threading.Tasks.Dataflow.ITargetBlock<TOutput> target, Predicate<TOutput> predicate);

Type Parameters

TOutput

Specifies the type of data contained in the source.

Parameters

source
ISourceBlock<TOutput>

The source from which to link.

target
ITargetBlock<TOutput>

The ITargetBlock<TInput> to which to connect the source.

predicate
Predicate<TOutput>

The filter a message must pass in order for it to propagate from the source to the target.

Returns

An IDisposable that, upon calling Dispose, will unlink the source from the target.

Exceptions

The source is null.

-or-

The target is null.

-or-

The predicate is null.

Applies to

.NET 10 and other versions
Product Versions
.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

LinkTo<TOutput>(ISourceBlock<TOutput>, ITargetBlock<TOutput>, DataflowLinkOptions, Predicate<TOutput>)

Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs

Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> using the specified filter.

C#
public static IDisposable LinkTo<TOutput>(this System.Threading.Tasks.Dataflow.ISourceBlock<TOutput> source, System.Threading.Tasks.Dataflow.ITargetBlock<TOutput> target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions, Predicate<TOutput> predicate);

Type Parameters

TOutput

Specifies the type of data contained in the source.

Parameters

source
ISourceBlock<TOutput>

The source from which to link.

target
ITargetBlock<TOutput>

The ITargetBlock<TInput> to which to connect the source.

linkOptions
DataflowLinkOptions

One of the enumeration values that specifies how to configure a link between dataflow blocks.

predicate
Predicate<TOutput>

The filter a message must pass in order for it to propagate from the source to the target.

Returns

An IDisposable that, upon calling Dispose, will unlink the source from the target.

Exceptions

The source is null (Nothing in Visual Basic).

-or-

The target is null (Nothing in Visual Basic).

-or-

The linkOptions is null (Nothing in Visual Basic).

-or-

The predicate is null (Nothing in Visual Basic).

Applies to

.NET 10 and other versions
Product Versions
.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