AsyncLock.NET 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package AsyncLock.NET --version 1.0.1                
NuGet\Install-Package AsyncLock.NET -Version 1.0.1                
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="AsyncLock.NET" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AsyncLock.NET --version 1.0.1                
#r "nuget: AsyncLock.NET, 1.0.1"                
#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.
// Install AsyncLock.NET as a Cake Addin
#addin nuget:?package=AsyncLock.NET&version=1.0.1

// Install AsyncLock.NET as a Cake Tool
#tool nuget:?package=AsyncLock.NET&version=1.0.1                

logo

NuGet Status Build Status MIT Licence donate

🔒 .NET Nuget for a basic asynchronous locking recipe

Installation

Find it on nuget!

PM> Install-Package AsyncLock.NET -Version 1.0.1

API

Example usage

// example of an asynchronous operation setting a SignalR connection
HubConnection connection;

await AsyncLock.ExecuteWithLock(async () =>
{
    connection = await GetConnection("https://that.place.on.the.internet/hub");
});

await connection.StartAsync();
// example of setting the maximum number of requests for the semaphore 
// that can be granted concurrently which defaults to one
AsyncLock.MaxCount = 5;

// act
await AsyncLock.ExecuteWithLock(async () =>
{
    await Task.Delay(1000);

    return "Test";
});
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

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
6.0.1 511 10/16/2022
6.0.0 426 10/13/2022
1.0.2 409 10/13/2022
1.0.1 310 12/13/2021
1.0.0 410 12/13/2021