HostLoom.Scheduling.Testing
0.15.1
See the version list below for details.
dotnet add package HostLoom.Scheduling.Testing --version 0.15.1
NuGet\Install-Package HostLoom.Scheduling.Testing -Version 0.15.1
<PackageReference Include="HostLoom.Scheduling.Testing" Version="0.15.1" />
<PackageVersion Include="HostLoom.Scheduling.Testing" Version="0.15.1" />
<PackageReference Include="HostLoom.Scheduling.Testing" />
paket add HostLoom.Scheduling.Testing --version 0.15.1
#r "nuget: HostLoom.Scheduling.Testing, 0.15.1"
#:package HostLoom.Scheduling.Testing@0.15.1
#addin nuget:?package=HostLoom.Scheduling.Testing&version=0.15.1
#tool nuget:?package=HostLoom.Scheduling.Testing&version=0.15.1
HostLoom.Scheduling.Testing
This package tests consumers of HostLoom.Scheduling without a backend. It references the
kernel only.
ManualScheduleGuard is an in-process IScheduleGuard a test can script: Hold(name) refuses
the next claims as if another instance ran the schedule, Release(name) lets them through,
Lose(name) cancels the lost token of an active claim as an expired lease would, and
FailNext(exception) makes the next claim throw as an unreachable backend would. Claims lists
every attempt with its lease and whether it was granted; Active lists the schedules claimed
right now. IsCoordinated is settable, true by default, to stand in for a guard over a disabled
lock.
var guard = new ManualScheduleGuard();
guard.Hold("catalog:rebuild");
await using var scheduler = new Scheduler(new SchedulingOptions(), [nightly], guard, clock);
await scheduler.StartAsync();
clock.Advance(TimeSpan.FromHours(2));
// The run was skipped; guard.Claims[^1].Granted is false and the job never ran.
Drive time with a deterministic TimeProvider: the scheduler waits, times out, and stamps runs
on the clock it was given, so a test advances the clock instead of sleeping.
| 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.Scheduling (>= 0.15.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.