HostLoom.Leadership.Testing 0.17.0

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

HostLoom.Leadership.Testing

This package tests leader-only consumers of HostLoom.Leadership without an elector or a lock backend. It references the kernel only.

ManualLeadership is an ILeadership a test flips by hand: Acquire() makes the instance leader for a new term and releases WaitForLeadershipAsync waiters, Lose() ends leadership as an expired lease would, cancelling LeadershipToken and raising Lost, and Resign() ends it as a resignation. Changes lists every change raised, so a consumer's reaction to each transition is asserted in order. IsCoordinated is settable, true by default, to stand in for an elector over a disabled lock.

using var leadership = new ManualLeadership("scheduler");
var loop = new ReconcilerLoop(leadership);
await loop.StartAsync(token);

leadership.Acquire();          // the loop's leader-only work starts
leadership.Lose();             // its token cancels; the work must stop

Pair it with LeaderScheduleGuard from HostLoom.Scheduling.Leadership to drive a scheduler through leadership changes with a deterministic clock.

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.17.0 51 10/25/2026
0.16.1 54 10/22/2026
0.16.0 87 10/14/2026
0.15.1 87 10/12/2026
0.15.0 104 10/4/2026
0.14.0 95 10/4/2026
0.13.0 105 9/28/2026
0.12.0 96 9/27/2026
0.11.0 100 9/25/2026
0.10.0 102 9/22/2026
0.9.0 105 9/22/2026