NCode.Coordination.Hosting 0.19.0

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

NCode.Coordination.Hosting

CI Target framework License

The hosting of NCode.Coordination: a node that holds a session for as long as its host runs and joins its cluster's membership with it.

Adding it

builder.Services.AddCoordinationHosting(builder.Configuration.GetSection(CoordinationHostOptions.SectionName));
builder.Services.AddCoordination(coordination => coordination
    .AddRespProvider(resp => resp.Configuration = "valkey.internal:6379,ssl=true")
    .Bind(new ProviderBinding(RespCoordinationBuilderExtensions.ProviderName))
    .RequireHostSession());
builder.Services.AddHealthChecks().AddCoordinationCheck();

The Coordination:Host section, or the options set in code, name the node's cluster, node id and address, and the host refuses to start with options that aren't valid. Once the composition's requirements pass, the host opens its session without holding up its start, joins its cluster's membership group, renews the session on its own clock and opens a new one at once when it is lost. Once every hosted service has stopped, the host closes the session, which releases every lease and membership entry bound to it.

RequireHostSession fails the start when no binding keeps sessions, and AddCoordinationCheck reports the host not ready while it holds no session.

Using the session

var sessions = host.Services.GetRequiredService<IHostSessionService>();
var session = await sessions.WaitForSessionAsync(cancellationToken);
var terms = LeaseTerms.ForSession(session.Id);

A lease bound to the session ends with it; session.Ended is a token that is cancelled when it does.

The repository's README has a quick start and the usage of each part.

Product Compatible and additional computed target framework versions.
.NET 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
0.19.0 0 11/30/2026
0.18.0 44 11/30/2026
0.17.0 46 11/30/2026
0.16.4 50 11/29/2026
0.16.3 53 11/29/2026
0.16.2 47 11/29/2026
0.16.1 51 11/29/2026
0.16.0 51 11/29/2026
0.15.0 45 11/29/2026
0.14.2 63 11/28/2026
0.14.1 54 11/28/2026
0.14.0 54 11/28/2026
0.13.0 60 11/27/2026
0.12.0 60 11/27/2026
0.11.0 56 11/26/2026
0.10.0 59 11/26/2026
0.9.0 56 11/26/2026
0.8.0 62 11/26/2026