Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

EricksonLopez.DistributedLock Overview

EricksonLopez.DistributedLock (1.0.0 on NuGet, L2) provides database and Redis-backed distributed locking primitives integrated with EricksonLopez.Result.

  • No silent lock-loss continuations: IDistributedLockHandle exposes HandleLostToken (CancellationToken) alongside ResourceId, LockId, and optional FencingToken, allowing long-running work to abort immediately if the backend lease drops.
  • Result-driven acquisition: TryAcquireAsync, AcquireAsync, and ExecuteWithLockAsync return Task<Result<...>> (LockAlreadyHeld, Timeout, LockLost, Canceled) without using exceptions for expected contention.
  • No root metapackage: There is no EricksonLopez.DistributedLock package — install EricksonLopez.DistributedLock.Abstractions plus the target backend package.
flowchart LR
App["Caller"] --> P["IDistributedLockProvider"]
P -- Contention --> Err["Result.Failure(LockAlreadyHeld / Timeout)"]
P -- Acquired --> H["IDistributedLockHandle (HandleLostToken)"]
H --> Work["Protected Work (linked CancellationToken)"]
Work --> Rel["await using DisposeAsync()"]
Distributed Lock Acquisition and Lease LifecycleCaller acquires IDistributedLockHandle from IDistributedLockProvider, links HandleLostToken with caller cancellation, executes protected work, and releases the lock on DisposeAsync.
View accessible text summary and structure

Caller acquires IDistributedLockHandle from IDistributedLockProvider, links HandleLostToken with caller cancellation, executes protected work, and releases the lock on DisposeAsync.

flowchart LR
App["Caller"] --> P["IDistributedLockProvider"]
P -- Contention --> Err["Result.Failure(LockAlreadyHeld / Timeout)"]
P -- Acquired --> H["IDistributedLockHandle (HandleLostToken)"]
H --> Work["Protected Work (linked CancellationToken)"]
Work --> Rel["await using DisposeAsync()"]

All 8 packages are published at 1.0.0 on NuGet (1,146 total downloads; localVersion: 2.1.0 on disk), target net8.0;net9.0;net10.0, and declare IsAotCompatible=true / EnableTrimAnalyzer=true (Full AOT):

Package NuGet (1.0.0) Local HEAD AOT Status Role
EricksonLopez.DistributedLock.Abstractions Published (244 dl) 2.1.0 Full IDistributedLockProvider, IDistributedLockHandle, DistributedLockErrors, ExecuteWithLockAsync
EricksonLopez.DistributedLock.PostgreSql Published (134 dl) 2.1.0 Full PostgreSQL advisory locks (pg_advisory_lock / xact)
EricksonLopez.DistributedLock.Redis Published (132 dl) 2.1.0 Full* Redis lease locks (*AOT support depends on StackExchange.Redis version)
EricksonLopez.DistributedLock.Oracle Published (131 dl) 2.1.0 Full Oracle DBMS_LOCK provider
EricksonLopez.DistributedLock.MariaDb Published (130 dl) 2.1.0 Full MariaDB GET_LOCK provider
EricksonLopez.DistributedLock.Sqlite Published (127 dl) 2.1.0 Full SQLite lease table provider
EricksonLopez.DistributedLock.MySql Published (126 dl) 2.1.0 Full MySQL GET_LOCK provider
EricksonLopez.DistributedLock.SqlServer Published (122 dl) 2.1.0 Full SQL Server sp_getapplock provider

Benchmark Status: hasBenchmarks: false — public BenchmarkDotNet artifacts are not published in benchmarks.json (MEGA-AUDIT-only reports are excluded).