DataflowBlock.AsObserver<TInput> Method

.NET Framework (current version)

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

Namespace:  System.Threading.Tasks.Dataflow
Assembly:  System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)

public static IObserver<TInput> AsObserver<TInput>(
	this ITargetBlock<TInput> target

Type Parameters


Specifies the type of input accepted by the target block.


Type: System.Threading.Tasks.Dataflow.ITargetBlock<TInput>

The target to wrap.

Return Value

Type: System.IObserver<TInput>
An observer that wraps the target block.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ITargetBlock<TInput>. 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).

.NET Framework

Supported in: 4.5

Portable Class Library

Supported in: Portable Class Library