Goldpath.Locking 0.1.0-preview.8

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

Goldpath.Locking

Ring B distributed locking: Medallion DistributedLock composed behind manifest-driven provider selection — Redis (RedLock), Postgres (advisory locks) or SQL Server (sp_getapplock) — with tenant-scoped lock names and acquire metrics.

Honest scope: locks reduce duplicate work; they are NOT correctness fences (no fencing tokens — a paused holder can outlive its lock). Correctness comes from the Idempotency module; the two compose.

Getting started

builder.AddGoldpathLocking();                       // provider per manifest

public sealed class SettlementJob(IDistributedLockProvider locks, GoldpathLockNames names)
{
    public async Task RunAsync(CancellationToken ct)
    {
        await using var handle = await locks.TryAcquireLockAsync(
            names.For("settlement"), TimeSpan.FromSeconds(5), ct);
        if (handle is null) return;            // another instance holds it — that's the point
        // ... exactly one instance runs this ...
    }
}

IDistributedLockProvider is Medallion's own interface — no Goldpath wrapper; the full acquire API (wait, try-with-timeout, sync/async) is the library's, documented not rewritten.

Configuration

"Goldpath": {
  "DistributedLocking": {
    "Provider": "Redis",                       // Redis | Postgres | SqlServer
    "ConnectionName": "redis"                  // db providers: point at the app db → ZERO new infra
  }
}

Advanced

  • Names are tenant-scoped and fail-closed: names.For("nightly-report")goldpath:{tenant}:lock:nightly-report; with NO ambient tenant it THROWS (a silent cross-tenant lock collision is a correctness bug). Background flows either pin a tenant with GoldpathTenant.Use(...) or declare GoldpathLockNames.Global("name") — explicit and greppable.
  • Metrics via a decorator over the same interface (composition, not a wrapper abstraction): goldpath_lock_acquire_total{outcome} and goldpath_lock_wait_seconds flow into Ring A OTel.
  • Provider swap is behavior-neutral — the same contract test runs against real Redis AND real Postgres in CI (LockContractTests).
  • Timeout semantics: TryAcquire* returns null on contention (no exception); Acquire* waits and throws TimeoutException — pick by intent.

Providers

Redis (reuses the caching L2 connection by default) · Postgres advisory locks · SQL Server sp_getapplock. ZooKeeper/etcd deferred until a project demands them (RFC).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (1)

Showing the top 1 NuGet packages that depend on Goldpath.Locking:

Package Downloads
Goldpath.Locking.SqlServer

SQL Server provider (sp_getapplock) for Goldpath.Locking. Ships separately ON PURPOSE: its dependency chain carries Microsoft's proprietary-but-free SqlClient SNI runtime (Microsoft Software License Terms — closed source, free of charge). Only teams that explicitly choose SQL Server — and therefore already run commercially-licensed Microsoft data infrastructure — take that dependency; the core Goldpath.Locking graph stays fully open source.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.8 89 9/7/2026
0.1.0-preview.7 94 9/1/2026
0.1.0-preview.6 382 8/4/2026
0.1.0-preview.5 96 7/28/2026
0.1.0-preview.4 83 7/27/2026
0.1.0-preview.3 64 7/25/2026
0.1.0-preview.2 72 7/13/2026
0.1.0-preview.1 105 7/13/2026