TransformManyBlock<TInput,TOutput> TransformManyBlock<TInput,TOutput> TransformManyBlock<TInput,TOutput> TransformManyBlock<TInput,TOutput> Class

Definition

Provides a dataflow block that invokes a provided Func<T,TResult> delegate for every data element received.

generic <typename TInput, typename TOutput>
public ref class TransformManyBlock sealed : System::Threading::Tasks::Dataflow::IPropagatorBlock<TInput, TOutput>, System::Threading::Tasks::Dataflow::IReceivableSourceBlock<TOutput>, System::Threading::Tasks::Dataflow::ISourceBlock<TOutput>, System::Threading::Tasks::Dataflow::ITargetBlock<TInput>
public sealed class TransformManyBlock<TInput,TOutput> : System.Threading.Tasks.Dataflow.IPropagatorBlock<TInput,TOutput>, System.Threading.Tasks.Dataflow.IReceivableSourceBlock<TOutput>, System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>, System.Threading.Tasks.Dataflow.ITargetBlock<TInput>
type TransformManyBlock<'Input, 'Output> = class
    interface IDataflowBlock
    interface IPropagatorBlock<'Input, 'Output>
    interface ISourceBlock<'Output>
    interface ITargetBlock<'Input>
    interface IReceivableSourceBlock<'Output>
Public NotInheritable Class TransformManyBlock(Of TInput, TOutput)
Implements IPropagatorBlock(Of TInput, TOutput), IReceivableSourceBlock(Of TOutput), ISourceBlock(Of TOutput), ITargetBlock(Of TInput)
Type Parameters
TInput

Specifies the type of data received and operated on by this TransformManyBlock<TInput,TOutput>.

TOutput

Specifies the type of data output by this TransformManyBlock<TInput,TOutput>.

Inheritance
TransformManyBlock<TInput,TOutput>TransformManyBlock<TInput,TOutput>TransformManyBlock<TInput,TOutput>TransformManyBlock<TInput,TOutput>
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.

Constructors

TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>) TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>) TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>) TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>)

Initializes a new TransformManyBlock<TInput,TOutput> with the specified function.

TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>, ExecutionDataflowBlockOptions) TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>, ExecutionDataflowBlockOptions) TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>, ExecutionDataflowBlockOptions) TransformManyBlock<TInput,TOutput>(Func<TInput,IEnumerable<TOutput>>, ExecutionDataflowBlockOptions)

Initializes a new TransformManyBlock<TInput,TOutput> with the specified function and ExecutionDataflowBlockOptions.

TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>) TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>) TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>) TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>)

Initializes a new TransformManyBlock<TInput,TOutput> with the specified function.

TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>, ExecutionDataflowBlockOptions) TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>, ExecutionDataflowBlockOptions) TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>, ExecutionDataflowBlockOptions) TransformManyBlock<TInput,TOutput>(Func<TInput,Task<IEnumerable<TOutput>>>, ExecutionDataflowBlockOptions)

Initializes a new TransformManyBlock<TInput,TOutput> with the specified function and ExecutionDataflowBlockOptions.

Properties

Completion Completion Completion Completion

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

InputCount InputCount InputCount InputCount

Gets the number of input items waiting to be processed by this block.

OutputCount OutputCount OutputCount OutputCount

Gets the number of output items available to be received from this block.

Methods

Complete() Complete() Complete() Complete()

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
LinkTo(ITargetBlock<TOutput>, DataflowLinkOptions) LinkTo(ITargetBlock<TOutput>, DataflowLinkOptions) LinkTo(ITargetBlock<TOutput>, DataflowLinkOptions) LinkTo(ITargetBlock<TOutput>, DataflowLinkOptions)

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

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the formatted name of this IDataflowBlock instance.

TryReceive(Predicate<TOutput>, TOutput) TryReceive(Predicate<TOutput>, TOutput) TryReceive(Predicate<TOutput>, TOutput) TryReceive(Predicate<TOutput>, TOutput)

Attempts to synchronously receive an available output item from the IReceivableSourceBlock<TOutput>.

TryReceiveAll(IList<TOutput>) TryReceiveAll(IList<TOutput>) TryReceiveAll(IList<TOutput>) TryReceiveAll(IList<TOutput>)

Attempts to synchronously receive all available items from the IReceivableSourceBlock<TOutput>.

Explicit Interface Implementations

IDataflowBlock.Fault(Exception) IDataflowBlock.Fault(Exception) IDataflowBlock.Fault(Exception) IDataflowBlock.Fault(Exception)

Causes the IDataflowBlock to complete in a Faulted state.

ISourceBlock<TOutput>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean) ISourceBlock<TOutput>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean) ISourceBlock<TOutput>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean) ISourceBlock<TOutput>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean)

Called by a linked ITargetBlock<TInput> to accept and consume a DataflowMessageHeader previously offered by this ISourceBlock<TOutput>.

ISourceBlock<TOutput>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<TOutput>) ISourceBlock<TOutput>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<TOutput>) ISourceBlock<TOutput>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<TOutput>) ISourceBlock<TOutput>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<TOutput>)

Called by a linked ITargetBlock<TInput> to release a previously reserved DataflowMessageHeader by this ISourceBlock<TOutput>.

ISourceBlock<TOutput>.ReserveMessage(DataflowMessageHeader, ITargetBlock<TOutput>) ISourceBlock<TOutput>.ReserveMessage(DataflowMessageHeader, ITargetBlock<TOutput>) ISourceBlock<TOutput>.ReserveMessage(DataflowMessageHeader, ITargetBlock<TOutput>) ISourceBlock<TOutput>.ReserveMessage(DataflowMessageHeader, ITargetBlock<TOutput>)

Called by a linked ITargetBlock<TInput> to reserve a previously offered DataflowMessageHeader by this ISourceBlock<TOutput>.

ITargetBlock<TInput>.OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean) ITargetBlock<TInput>.OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean) ITargetBlock<TInput>.OfferMessage(DataflowMessageHeader, TInput, ISourceBlock<TInput>, Boolean) ITargetBlock<TInput>.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

AsObservable<TOutput>(ISourceBlock<TOutput>) AsObservable<TOutput>(ISourceBlock<TOutput>) AsObservable<TOutput>(ISourceBlock<TOutput>) AsObservable<TOutput>(ISourceBlock<TOutput>)

Creates a new IObservable<T> abstraction over the ISourceBlock<TOutput>.

AsObserver<TInput>(ITargetBlock<TInput>) AsObserver<TInput>(ITargetBlock<TInput>) AsObserver<TInput>(ITargetBlock<TInput>) AsObserver<TInput>(ITargetBlock<TInput>)

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

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

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

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

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

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

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

OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>)

Provides a Task<TResult> that asynchronously monitors the source for available output.

OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken)

Provides a Task<TResult> that asynchronously monitors the source for available output.

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

Posts an item to the ITargetBlock<TInput>.

Receive<TOutput>(ISourceBlock<TOutput>) Receive<TOutput>(ISourceBlock<TOutput>) Receive<TOutput>(ISourceBlock<TOutput>) Receive<TOutput>(ISourceBlock<TOutput>)

Synchronously receives a value from a specified source.

Receive<TOutput>(ISourceBlock<TOutput>, CancellationToken) Receive<TOutput>(ISourceBlock<TOutput>, CancellationToken) Receive<TOutput>(ISourceBlock<TOutput>, CancellationToken) Receive<TOutput>(ISourceBlock<TOutput>, CancellationToken)

Synchronously receives a value from a specified source and provides a token to cancel the operation.

Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan) Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan) Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan) Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan)

Synchronously receives a value from a specified source, observing an optional time-out period.

Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken) Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken) Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken) Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken)

Synchronously receives a value from a specified source, providing a token to cancel the operation and observing an optional time-out interval.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>) ReceiveAsync<TOutput>(ISourceBlock<TOutput>) ReceiveAsync<TOutput>(ISourceBlock<TOutput>) ReceiveAsync<TOutput>(ISourceBlock<TOutput>)

Asynchronously receives a value from a specified source.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken)

Asynchronously receives a value from a specified source and provides a token to cancel the operation.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan)

Asynchronously receives a value from a specified source, observing an optional time-out period.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken) ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken)

Asynchronously receives a value from a specified source, providing a token to cancel the operation and observing an optional time-out interval.

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

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

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

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

TryReceive<TOutput>(IReceivableSourceBlock<TOutput>, TOutput) TryReceive<TOutput>(IReceivableSourceBlock<TOutput>, TOutput) TryReceive<TOutput>(IReceivableSourceBlock<TOutput>, TOutput) TryReceive<TOutput>(IReceivableSourceBlock<TOutput>, TOutput)

Attempts to synchronously receive an item from the ISourceBlock<TOutput>.

Applies to