Class ParallelVariableLength<TIn, TOut>
Creates and applies a sub-pipeline to each element in the input array. The input array can have variable length. The sub-pipelines have index affinity, meaning the same sub-pipeline is re-used across multiple messages for the entry with the same index in the array.
Inherited Members
Namespace: Microsoft.Psi.Components
Assembly: Microsoft.Psi.dll
Syntax
public class ParallelVariableLength<TIn, TOut> : Subpipeline, ISourceComponent, IConsumer<TIn[]>, IProducer<TOut[]>
Type Parameters
Name | Description |
---|---|
TIn | The input message type. |
TOut | The result type. |
Constructors
View SourceParallelVariableLength(Pipeline, Action<Int32, IProducer<TIn>>, String, DeliveryPolicy)
Initializes a new instance of the ParallelVariableLength<TIn, TOut> class.
Declaration
public ParallelVariableLength(Pipeline pipeline, Action<int, IProducer<TIn>> action, string name = "ParallelVariableLength", DeliveryPolicy defaultDeliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The pipeline to add the component to. |
Action<System.Int32, IProducer<TIn>> | action | Function mapping keyed input producers to output producers. |
String | name | An optional name for the component. |
DeliveryPolicy | defaultDeliveryPolicy | Pipeline-level default delivery policy to be used by this component (defaults to Unlimited if unspecified). |
ParallelVariableLength(Pipeline, Func<Int32, IProducer<TIn>, IProducer<TOut>>, Boolean, TOut, String, DeliveryPolicy)
Initializes a new instance of the ParallelVariableLength<TIn, TOut> class.
Declaration
public ParallelVariableLength(Pipeline pipeline, Func<int, IProducer<TIn>, IProducer<TOut>> transform, bool outputDefaultIfDropped = false, TOut defaultValue = null, string name = "ParallelVariableLength", DeliveryPolicy defaultDeliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The pipeline to add the component to. |
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 | An optional name for the component. |
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()