HostLoom.Leadership.Testing
0.12.0
See the version list below for details.
dotnet add package HostLoom.Leadership.Testing --version 0.12.0
NuGet\Install-Package HostLoom.Leadership.Testing -Version 0.12.0
<PackageReference Include="HostLoom.Leadership.Testing" Version="0.12.0" />
<PackageVersion Include="HostLoom.Leadership.Testing" Version="0.12.0" />
<PackageReference Include="HostLoom.Leadership.Testing" />
paket add HostLoom.Leadership.Testing --version 0.12.0
#r "nuget: HostLoom.Leadership.Testing, 0.12.0"
#:package HostLoom.Leadership.Testing@0.12.0
#addin nuget:?package=HostLoom.Leadership.Testing&version=0.12.0
#tool nuget:?package=HostLoom.Leadership.Testing&version=0.12.0
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 | 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
- HostLoom.Leadership (>= 0.12.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.