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
<PackageReference Include="NCode.Coordination.Hosting" Version="0.19.0" />
<PackageVersion Include="NCode.Coordination.Hosting" Version="0.19.0" />
<PackageReference Include="NCode.Coordination.Hosting" />
paket add NCode.Coordination.Hosting --version 0.19.0
#r "nuget: NCode.Coordination.Hosting, 0.19.0"
#:package NCode.Coordination.Hosting@0.19.0
#addin nuget:?package=NCode.Coordination.Hosting&version=0.19.0
#tool nuget:?package=NCode.Coordination.Hosting&version=0.19.0
NCode.Coordination.Hosting
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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 11.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 11.0.0)
- NCode.Coordination.Abstractions (>= 0.19.0)
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 |
See the changelog: https://github.com/NCodeGroup/Coordination/blob/HEAD/CHANGELOG.md