Niobium.Platform.Locking 3.2.16

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

Niobium.Platform.Locking

Niobium.Platform.Locking provides abstractions, policies, and helpers for distributed locking, impediment management, and resource control in .NET applications. It enables robust, extensible, and testable mechanisms for business process locking, impediment tracking, and policy-driven access control.

What is this project about?

  • Defines interfaces and base types for impediment (lock/block) management.
  • Implements distributed locking and impediment policies for business resources.
  • Provides extension methods for impediment operations (impede, unimpede, query).
  • Integrates with Niobium.Platform and Niobium.Database.StorageTable for scalable, persistent locking.
  • Used by Niobium.* and consumer projects to standardize distributed locking and impediment management.

Getting Started

1. Install the NuGet Package

Add the package to your .NET project:

dotnet add package Niobium.Platform.Locking

2. Register Locking Services

In your DI setup, use the provided dependency module:

using Niobium.Platform.Locking;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
services.AddPlatformLocking();

3. Implement and Use Impedable Resources

Implement the IImpedable interface for your business resource:

using Niobium.Platform.Locking;

public class MyResource : IImpedable
{
    public string GetImpedementID() => "resource-id";
    public IEnumerable<IImpedimentPolicy> ImpedimentPolicies { get; }
}

4. Impede and Unimpede Resources

Use the extension methods to impede (lock) or unimpede (unlock) resources:

await myResource.ImpedeAsync("CategoryA", 1, "PolicyInput");
await myResource.UnimpedeAsync("CategoryA", 1, "PolicyInput");

5. Query Impediments

Query impediments (locks) for a resource:

await foreach (var impediment in myResource.GetImpedimentsByCategoryAsync("CategoryA"))
{
    // Process impediment
}

How Niobium.Platform.Locking is Consumed

Consumer projects use Niobium.Platform.Locking to:

  • Register and use distributed locking and impediment policies via DI.
  • Standardize lock/impediment management for business resources.
  • Integrate with persistent storage for scalable, reliable locking.
  • Extend or implement custom impediment policies for advanced scenarios.

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with clear commit messages
  4. Submit a pull request

Please ensure your code follows the existing style and includes appropriate tests and documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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 was computed.  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
3.2.16 234 9/3/2025
3.2.15 191 9/3/2025
3.2.14 212 9/2/2025
3.2.13 205 9/2/2025
3.2.12 204 9/1/2025
3.2.11 207 9/1/2025
3.2.10 205 9/1/2025
3.2.9 223 8/31/2025
3.0.8 275 8/26/2025