FluxFlow.Composition.Hosting 1.1.0

dotnet add package FluxFlow.Composition.Hosting --version 1.1.0
                    
NuGet\Install-Package FluxFlow.Composition.Hosting -Version 1.1.0
                    
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.Composition.Hosting" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxFlow.Composition.Hosting" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FluxFlow.Composition.Hosting" />
                    
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.Composition.Hosting --version 1.1.0
                    
#r "nuget: FluxFlow.Composition.Hosting, 1.1.0"
                    
#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.Composition.Hosting@1.1.0
                    
#: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.Composition.Hosting&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FluxFlow.Composition.Hosting&version=1.1.0
                    
Install as a Cake Tool

FluxFlow.Composition.Hosting

Optional hosting bridge for FluxFlow.Composition.

Use this package when a .NET host wants DI/configuration to own composition startup while keeping concrete resources in adapter packages.

Boundary

This package owns:

  • registering a single composition runtime with IServiceCollection
  • loading a CompositionDefinition from an object or IConfiguration
  • building the runtime through CompositionRuntimeBuilder
  • starting and stopping the runtime through IHostedService
  • exposing build diagnostics through ICompositionRuntimeHost

Named node resources resolve through the CompositionNodeFactoryContext instance methods in FluxFlow.Composition; this package's role is registering the composition runtime against the host's keyed services. The older context extension methods in this package remain as obsolete delegating wrappers.

It does not own resource creation policies. Adapter packages still own concrete clients, stores, reconnect behavior, secrets, hosted client lifetime, and adapter-specific options.

Registration

services.AddKeyedSingleton<IMessageStore>("primary", new InMemoryMessageStore());

services
    .AddFluxFlowComposition(configuration)
    .RegisterNodes(registry => registry.Register(
        "sample.sink",
        context =>
        {
            var store = context.GetRequiredResource<IMessageStore>("store");
            var node = new StoreSinkNode(store);
            return ValueTask.FromResult(ComposedNode.Create(
                node,
                inputs: [CompositionPorts.Input<string>("Input", node.Input)]));
        },
        inputs: [CompositionPorts.Metadata<string>("Input")]));

Reusable packages or hosts can also register explicit contributor classes or instances:

services
    .AddFluxFlowComposition(configuration)
    .RegisterNodeContributor<AppCompositionNodes>();

Contributor registration is explicit and duplicate-safe by implementation type. The hosting package does not scan assemblies or discover node factories implicitly.

Configuration records the resource reference by name:

{
  "workflows": {
    "main": {
      "nodes": {
        "sink": {
          "type": "sample.sink",
          "resources": {
            "store": "primary"
          }
        }
      }
    }
  }
}

The node factory asks for the local resource slot (store), and hosting resolves the keyed service named primary. Resource slot names passed to the factory helpers and configured keyed service references are trimmed before lookup, so incidental surrounding whitespace does not change which host-owned service is resolved.

Runtime Access

var host = services.GetRequiredService<ICompositionRuntimeHost>();

foreach (var diagnostic in host.Diagnostics)
{
    Console.Error.WriteLine(diagnostic.Message);
}

By default the hosted service builds and starts the runtime with the host and throws CompositionHostingException if the composition cannot be built. CompositionHostingException.Diagnostics is a construction-time snapshot, so callers can safely keep the exception as stable build-failure evidence. Hosted and manual start/stop calls are idempotent at the hosting boundary: a runtime that is already started is not started again, and a runtime that has already been stopped is not completed or started again.

If you already have the exact section, call AddFluxFlowCompositionSection(...). The hosting registration APIs reject null service collections, definitions, configuration roots, definition sources, node registration delegates, and options configuration delegates. A null section name is rejected explicitly; pass an empty string only when the supplied configuration object is already the exact composition section.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 207 7/3/2026
1.0.5 603 7/2/2026

Marks the keyed-resource context extensions obsolete in favor of the CompositionNodeFactoryContext instance methods in FluxFlow.Composition.