EricksonLopez.DistributedLock Overview
L2StableNuGet: v1.0.0Local HEAD: v2.1.0AOT: Full
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:
IDistributedLockHandleexposesHandleLostToken(CancellationToken) alongsideResourceId,LockId, and optionalFencingToken, allowing long-running work to abort immediately if the backend lease drops. - Result-driven acquisition:
TryAcquireAsync,AcquireAsync, andExecuteWithLockAsyncreturnTask<Result<...>>(LockAlreadyHeld,Timeout,LockLost,Canceled) without using exceptions for expected contention. - No root metapackage: There is no
EricksonLopez.DistributedLockpackage — installEricksonLopez.DistributedLock.Abstractionsplus the target backend package.
Rendering diagram…
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()"]
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()"]Package Roster & Native AOT Status (8 / 8 Published)
Section titled “Package Roster & Native AOT Status (8 / 8 Published)”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 inbenchmarks.json(MEGA-AUDIT-only reports are excluded).