FluxFlow.Components.Routing 3.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluxFlow.Components.Routing --version 3.0.1
                    
NuGet\Install-Package FluxFlow.Components.Routing -Version 3.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FluxFlow.Components.Routing" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxFlow.Components.Routing" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FluxFlow.Components.Routing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FluxFlow.Components.Routing --version 3.0.1
                    
#r "nuget: FluxFlow.Components.Routing, 3.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FluxFlow.Components.Routing@3.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FluxFlow.Components.Routing&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=FluxFlow.Components.Routing&version=3.0.1
                    
Install as a Cake Tool

FluxFlow.Components.Routing

Standalone routing nodes for FluxFlow, built on the FluxFlow.Nodes kit. Every node is a self-contained TPL Dataflow processor: new it with its options and the selectors it needs, post FlowMessage<T> envelopes to its input(s), and link its broadcast output/error/ event ports to the next stage. No engine, registry, or runtime is required. Key and side extraction is supplied by the caller as plain delegates (compile them once from a FluxFlow.Mapping IFlowExpressionEngine / IFlowPredicate if you use expressions).

Nodes

Node Base Shape
FlowSwitchNode<TInput> FlowNode<TInput, TInput> InputMatched (primary Output), Default, optional Routed, configured route-output ports, Errors/Events
FlowForkNode<TInput> FlowNode<TInput, TInput> Input → each configured output (first is the primary Output), Errors/Events
FlowMergeNode<TInput> FlowNode<TInput, TInput> one fan-in Input (link many upstreams) → Output, Errors/Events
FlowWindowNode<TInput> FlowNode<TInput, FlowWindow<TInput>> InputOutput (windows), Errors/Events
FlowCorrelationNode<TInput> FlowNode<TInput, FlowCorrelationMatch<TInput>> InputMatched (primary Output), Timeouts, Errors/Events
FlowJoinNode<TLeft, TRight> kit primitives (two inputs) Left, RightOutput (results), Timeouts, Errors/Events

Every emitted message carries the source correlation id forward (FlowMessage<T>.With): the matched branch keeps the input's id, a join result keeps the left message's id, a correlation match keeps the request's id, and each timeout keeps its own message's id.

All nodes time off an injected System.TimeProvider (defaulting to TimeProvider.System), so windows, join timeouts, and correlation timeouts are deterministic under a FakeTimeProvider in tests.

Construction validates required option shape before the node pipeline is created. Blank InputType, non-positive BoundedCapacity, invalid window boundaries, and invalid correlation limits fail fast with routing-specific construction errors.

Switch

var node = new FlowSwitchNode<AppMessage>(
    new SwitchRoutingOptions
    {
        Routes = ["priority", "standard"],
        RouteOutputs = new Dictionary<string, string> { ["priority"] = "Priority" },
        DefaultRoute = "unknown"
    },
    routeKeySelector: message => message.Category);

Matched (the primary Output) re-emits the input when its route key is in Routes; Default re-emits it otherwise. If Routes is empty every non-empty key is treated as matched. RouteOutputs adds extra ports keyed by name and re-emits the input to the matching route port; several route keys may map to the same port. Set EmitRouteEnvelope to expose a neutral Routed port. EmitMatchedInput / EmitDefaultInput suppress those branches. Route-key selector failures surface on Errors and the node keeps processing.

Fork

var node = new FlowForkNode<AppMessage>(
    new ForkRoutingOptions { Outputs = ["Audit", "Transform", "Dashboard"] });

Each configured output receives every input. The first output is the primary Output; the rest are reached through node.Outputs[name]. Output names must be valid identifiers and cannot collide with the built-in Input/Errors ports.

Merge

var node = new FlowMergeNode<AppMessage>(new MergeRoutingOptions());
// link several upstreams into the one input:
sourceA.LinkTo(node.Input);
sourceB.LinkTo(node.Input);

A fan-in node: the single bounded Input already merges concurrent producers, and the node re-broadcasts each message on Output in arrival order, preserving correlation.

Window

var node = new FlowWindowNode<AppMessage>(
    new WindowRoutingOptions { MaxItems = 100, TimeMilliseconds = 5000 });

Output emits FlowWindow<TInput> (sequence, items, start/emit timestamps, duration, count, reason). MaxItems emits when the window fills; TimeMilliseconds emits when the open window ages out (timed off the injected clock); when both are set, whichever fires first wins. At least one boundary is required. On completion a partial window is emitted by default — set EmitPartialOnCompletion = false to discard it.

Correlation

var node = new FlowCorrelationNode<AppMessage>(
    new CorrelationRoutingOptions
    {
        RequestSide = "request",
        ResponseSide = "response",
        TimeoutMilliseconds = 30000
    },
    keySelector: message => message.CorrelationId,
    sideSelector: message => message.Kind);

Pairs a request with its matching response by key. Matched emits FlowCorrelationMatch<TInput>; Timeouts emits FlowCorrelationTimeout<TInput> for pending inputs that age past the timeout (observed before the next input or on completion). Invalid keys/sides, duplicate sides, selector failures, and pending-capacity overflow surface on Errors and the node keeps processing.

Join

var node = new FlowJoinNode<RequestMessage, ResponseMessage>(
    new JoinRoutingOptions { TimeoutMilliseconds = 30000 },
    leftKeySelector: request => request.CorrelationId,
    rightKeySelector: response => response.CorrelationId);

The one two-input routing node, built directly on kit primitives. Post to Left and Right; Output emits FlowJoinResult<TLeft, TRight> for matched pairs (FIFO for repeated keys) and Timeouts emits FlowJoinTimeout<TLeft, TRight> for values that age past the timeout or remain when the node completes. Key-evaluation failures, empty keys, and pending-capacity overflow surface on Errors and the node keeps processing.

Lifecycle

Each node implements IFlowNode: Complete() drains and completes the outputs, Fault faults the data outputs while flushing (completing) Errors/Events so buffered diagnostics survive, and await DisposeAsync() completes, drains, and releases timers.

Composition

The optional FluxFlow.Components.Routing.Composition package registers closed generic routing factories for FluxFlow.Composition. The adapter binds the existing routing options from node configuration and resolves host-owned keyed selector delegates plus optional keyed TimeProvider resources.

services.AddKeyedSingleton<Func<AppMessage, string?>>(
    "route",
    message => message.Category);

services
    .AddFluxFlowComposition(configuration)
    .RegisterNodes(registry => registry
        .RegisterSwitch<AppMessage>()
        .RegisterFork<AppMessage>()
        .RegisterMerge<AppMessage>()
        .RegisterWindow<AppMessage>()
        .RegisterCorrelation<AppMessage>()
        .RegisterJoin<RequestMessage, ResponseMessage>());

Use custom node type strings for multiple input shapes, for example flow.switch.order, flow.window.http, and flow.join.request-response. Selector expressions are not compiled by the composition adapter; compile or create delegates in the host and expose them as keyed resources such as routeKeySelector, keySelector, sideSelector, leftKeySelector, and rightKeySelector.

Invalid routing options, such as blank inputType, non-positive boundedCapacity, invalid window boundaries, or invalid correlation limits, fail during composition build and surface as factory diagnostics when build failures are configured as diagnostics.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FluxFlow.Components.Routing:

Package Downloads
FluxFlow.Components.Routing.Composition

Typed JSON routing registration and Designer metadata over host-owned selectors and clocks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.0-rc.1 70 9/5/2026
6.0.1 157 8/3/2026
3.0.2 126 7/3/2026
3.0.1 171 7/2/2026
3.0.0 120 6/19/2026
2.0.0 141 6/18/2026
1.2.1 121 6/15/2026
1.2.0 427 6/12/2026
1.1.0 115 6/5/2026
1.0.0 125 6/4/2026
0.10.0-alpha.1 238 6/2/2026
0.9.0-alpha.1 72 6/2/2026
0.8.0-alpha.1 69 6/2/2026
0.7.0-alpha.1 63 6/2/2026
0.6.1-alpha.1 75 6/2/2026
0.6.0-alpha.1 86 6/2/2026
0.5.0-alpha.1 60 6/2/2026
0.4.0-alpha.1 67 6/2/2026
0.3.0-alpha.1 63 6/2/2026
0.2.0-alpha.2 65 6/2/2026
Loading failed

Aligns constructor option validation with standalone node conventions: switch, fork, merge, window, and correlation nodes reject blank inputType and non-positive boundedCapacity values before the node pipeline is created; window and correlation-specific limits now fail with routing-specific construction errors.