Class ParallelFixedLength<TIn, TOut>
Creates and applies a sub-pipeline to each element in the input array. The input array must have the same length across all messages. The sub-pipelines have index affinity, meaning the same sub-pipeline is re-used across multiple messages for the entry with the same index.
Inherited Members
Namespace: Microsoft.Psi.Components
Assembly: Microsoft.Psi.dll
Syntax
public class ParallelFixedLength<TIn, TOut> : Subpipeline, ISourceComponent, IConsumer<TIn[]>, IProducer<TOut[]>
Type Parameters
Name | Description |
---|---|
TIn | The input message type. |
TOut | The result type. |
Constructors
View SourceParallelFixedLength(Pipeline, Int32, Action<Int32, IProducer<TIn>>, String, DeliveryPolicy)
Initializes a new instance of the ParallelFixedLength<TIn, TOut> class.
Declaration
public ParallelFixedLength(Pipeline pipeline, int vectorSize, Action<int, IProducer<TIn>> action, string name = null, DeliveryPolicy defaultDeliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The pipeline to add the component to. |
System.Int32 | vectorSize | Vector size. |
Action<System.Int32, IProducer<TIn>> | action | Action to apply to output producers. |
String | name | Name for this component (defaults to ParallelFixedLength). |
DeliveryPolicy | defaultDeliveryPolicy | Pipeline-level default delivery policy to be used by this component (defaults to Unlimited if unspecified). |
ParallelFixedLength(Pipeline, Int32, Func<Int32, IProducer<TIn>, IProducer<TOut>>, Boolean, TOut, String, DeliveryPolicy)
Initializes a new instance of the ParallelFixedLength<TIn, TOut> class.
Declaration
public ParallelFixedLength(Pipeline pipeline, int vectorSize, Func<int, IProducer<TIn>, IProducer<TOut>> transform, bool outputDefaultIfDropped, TOut defaultValue = null, string name = null, DeliveryPolicy defaultDeliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The pipeline to add the component to. |
System.Int32 | vectorSize | Vector size. |
Func<System.Int32, IProducer<TIn>, IProducer<TOut>> | transform | Function mapping keyed input producers to output producers. |
System.Boolean | outputDefaultIfDropped | When true, a result is produced even if a message is dropped in processing one of the input elements. In this case the corresponding output element is set to a default value. |
TOut | defaultValue | Default value to use when messages are dropped in processing one of the input elements. |
String | name | Name for this component (defaults to ParallelFixedLength). |
DeliveryPolicy | defaultDeliveryPolicy | Pipeline-level default delivery policy to be used by this component (defaults to Unlimited if unspecified). |
Properties
View SourceIn
Gets the input we receive messages on.
Declaration
public Receiver<TIn[]> In { get; }
Property Value
Type | Description |
---|---|
Receiver<TIn[]> |
Out
Gets the stream to write messages to.
Declaration
public Emitter<TOut[]> Out { get; }
Property Value
Type | Description |
---|---|
Emitter<TOut[]> |
Methods
View SourceDispose()
Declaration
public override void Dispose()