HostLoom.Scheduling.Locking 0.17.0

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

HostLoom.Scheduling.Locking

This package runs an exclusive HostLoom schedule on one instance at a time by claiming it through the HostLoom distributed lock, the way ShedLock guards a Spring @Scheduled method:

services
    .AddHostLoomLocking(locking => locking.Namespace = "catalog")
    .UseRedis();

services
    .AddHostLoomScheduling()
    .UseDistributedLock()
    .AddSchedule<RebuildCatalogJob>(
        "catalog:rebuild",
        ScheduleTrigger.Cron("0 0 2 * * *"),
        options => options.Exclusive = true);

DistributedLockScheduleGuard is an IScheduleGuard over IDistributedLock. Each run of an exclusive schedule makes one skip-if-busy acquisition of the key schedule:{name} for the schedule's lease (ScheduleOptions.Lease, else Scheduling:DefaultLease), so the lock's namespace, provider, and Locking:MaxLease apply. The scheduler keeps the claim past the run until the lease ends or its own next occurrence is due, so another instance reaching the same occurrence is refused. The lease is extended automatically while the claim is held, up to Locking:MaxHold; a run that outlives that bound loses its claim, and the claim's lost token cancels it. An instance that crashes leaves its key to expire at the lease end. A lock provider that cannot be reached throws, and the scheduler skips that run as GuardFailed rather than running unguarded.

The guard composes without a container, new DistributedLockScheduleGuard(distributedLock), for a scheduler built with new. UseDistributedLock() registers it as the one guard for the service collection and resolves the lock registered by AddHostLoomLocking.

Over a disabled lock (Locking:Enabled = false) every claim is granted on every instance, which is the lock's single-instance mode; the guard reports IsCoordinated = false, the scheduler warns once as ScheduleGuardUncoordinated, and its probe reports the guard as uncoordinated, so that mode is never silent.

The lock is coordination, not correctness: two instances can still run the same job when a lease is lost and the job ignores its token. Design every scheduled job so that running it twice is safe.

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 0 10/25/2026
0.16.1 39 10/22/2026
0.16.0 78 10/14/2026
0.15.1 82 10/12/2026
0.15.0 97 10/4/2026
0.14.0 99 10/4/2026
0.13.0 99 9/28/2026
0.12.0 94 9/27/2026
0.11.0 92 9/25/2026
0.10.0 98 9/22/2026
0.9.0 98 9/22/2026