AsyncKeyedLock 1.1.0

AsyncKeyedLock

An asynchronous .NET Standard 2.0 library that allows you to lock based on a key.

Installation

The recommended means is to use NuGet, but you could also download the source code from here.

Usage

using (var lockObj = await AsyncKeyedLocker.LockAsync(myObject))
{
	...
}

You can also set the maximum number of requests for the semaphore that can be granted concurrently (set to 1 by default):

AsyncKeyedLocker.MaxCount = 2;

If you would like to see how many concurrent requests there are for a semaphore for a given key:

int myCount = AsyncKeyedLocker.GetCount(myObject);

And if for some reason you need to force release the requests in the semaphore for a key:

AsyncKeyedLocker.ForceRelease(myObject);

Credits

This library is based on Stephen Cleary's solution.

Showing the top 20 packages that depend on AsyncKeyedLock.

Packages Downloads
EasyCaching.Core
EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
15
EasyCaching.Core
EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
17
EasyCaching.Core
EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
20
Volo.Abp.DistributedLocking.Abstractions
Package Description
15
Volo.Abp.DistributedLocking.Abstractions
Package Description
16
Volo.Abp.DistributedLocking.Abstractions
Package Description
17
Volo.Abp.DistributedLocking.Abstractions
Package Description
20

Allowed changing of max requests, getting request counts and force releasing locks.

.NET Standard 2.0

  • No dependencies.

Version Downloads Last updated
7.1.6 10 04/14/2025
7.1.5-alpha 5 04/14/2025
7.1.4 14 12/02/2024
7.1.4-preview 13 11/30/2024
7.1.3 13 11/19/2024
7.0.2 12 11/25/2024
7.0.1 13 11/28/2024
7.0.0 13 11/21/2024
7.0.0-rc3 11 11/25/2024
7.0.0-rc2 12 11/28/2024
7.0.0-rc1 11 11/30/2024
7.0.0-beta 9 01/01/2025
7.0.0-alpha 17 11/25/2024
6.4.2 13 05/29/2024
6.4.1 16 05/29/2024
6.4.0 16 05/29/2024
6.3.4 22 05/29/2024
6.3.4-rc 20 05/29/2024
6.3.4-beta 14 05/31/2024
6.3.3 16 05/29/2024
6.3.2 12 05/29/2024
6.3.0 23 05/29/2024
6.2.6 13 05/29/2024
6.2.5 16 05/29/2024
6.2.4 17 05/29/2024
6.2.3 14 05/29/2024
6.2.3-beta 18 05/31/2024
6.2.2 17 05/29/2024
6.2.1 17 05/29/2024
6.2.0 14 05/29/2024
6.1.1 17 05/29/2024
6.1.1-rc 14 05/29/2024
6.1.1-beta 18 05/31/2024
6.1.0 17 05/29/2024
6.0.5 20 05/29/2024
6.0.5-alpha 15 05/29/2024
6.0.4 17 05/29/2024
6.0.4-rc6 16 05/29/2024
6.0.4-rc5 14 05/29/2024
6.0.4-rc3 15 05/29/2024
6.0.4-rc 16 05/29/2024
6.0.4-beta 14 05/31/2024
6.0.4-alpha 16 05/29/2024
6.0.3 15 11/28/2024
6.0.2 13 05/29/2024
6.0.1 16 05/29/2024
5.1.2 15 05/29/2024
5.1.1 16 05/29/2024
5.1.0 14 05/29/2024
5.0.4 15 05/29/2024
5.0.3 18 05/29/2024
5.0.3-rc 15 05/29/2024
5.0.2-rc 13 05/29/2024
5.0.1 12 11/27/2024
4.0.2 14 05/29/2024
3.2.3 17 05/29/2024
3.2.1 15 05/29/2024
3.2.0 19 05/29/2024
3.0.1 18 05/29/2024
3.0.0 18 05/29/2024
2.0.3 15 05/29/2024
2.0.2 14 05/29/2024
2.0.1 16 05/29/2024
2.0.0 12 05/29/2024
1.1.0 18 05/29/2024
1.0.1 18 05/29/2024
1.0.0 14 05/29/2024