Class ParallelSparseDo<TIn, TBranchKey, TBranchIn>
Creates and executes parallel subpipelines based on an input stream and a splitter function.
Inherited Members
Namespace: Microsoft.Psi.Components
Assembly: Microsoft.Psi.dll
Syntax
public class ParallelSparseDo<TIn, TBranchKey, TBranchIn> : Subpipeline, ISourceComponent, IConsumer<TIn>
Type Parameters
Name | Description |
---|---|
TIn | The input message type. |
TBranchKey | The branch key type. |
TBranchIn | The branch input message type. |
Remarks
A splitter function is applied to each input message to generate a dictionary, and a subpipeline is created and executed for every key in the dictionary. A branch termination policy function governs when branches are terminated.
Constructors
View SourceParallelSparseDo(Pipeline, Func<TIn, Dictionary<TBranchKey, TBranchIn>>, Action<TBranchKey, IProducer<TBranchIn>>, Func<TBranchKey, Dictionary<TBranchKey, TBranchIn>, DateTime, (Boolean, DateTime)>, String, DeliveryPolicy)
Initializes a new instance of the ParallelSparseDo<TIn, TBranchKey, TBranchIn> class.
Declaration
public ParallelSparseDo(Pipeline pipeline, Func<TIn, Dictionary<TBranchKey, TBranchIn>> splitter, Action<TBranchKey, IProducer<TBranchIn>> action, Func<TBranchKey, Dictionary<TBranchKey, TBranchIn>, DateTime, (bool, DateTime)> branchTerminationPolicy = null, string name = "ParallelSparseDo", DeliveryPolicy defaultDeliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The pipeline to add the component to. |
Func<TIn, Dictionary<TBranchKey, TBranchIn>> | splitter | A function that generates a dictionary of key-value pairs for each given input message. |
Action<TBranchKey, IProducer<TBranchIn>> | action | Action to perform in parallel. |
Func<TBranchKey, Dictionary<TBranchKey, TBranchIn>, DateTime, System.ValueTuple<System.Boolean, DateTime>> | branchTerminationPolicy | Predicate function determining whether and when (originating time) to terminate branches (defaults to when key no longer present), given the current key, message payload (dictionary) and originating time. |
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> |