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!
48
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!
50
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!
51
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!
55
Volo.Abp.DistributedLocking.Abstractions
Package Description
47
Volo.Abp.DistributedLocking.Abstractions
Package Description
48
Volo.Abp.DistributedLocking.Abstractions
Package Description
49
Volo.Abp.DistributedLocking.Abstractions
Package Description
50
Volo.Abp.DistributedLocking.Abstractions
Package Description
51
Volo.Abp.DistributedLocking.Abstractions
Package Description
52
Volo.Abp.DistributedLocking.Abstractions
Package Description
53
Volo.Abp.DistributedLocking.Abstractions
Package Description
56
Volo.Abp.DistributedLocking.Abstractions
Package Description
59

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

.NET Standard 2.0

  • No dependencies.

Version Downloads Last updated
7.1.8 32 11/27/2025
7.1.8-beta5 26 11/25/2025
7.1.8-beta4 30 11/26/2025
7.1.8-beta3 26 11/25/2025
7.1.8-beta2 26 11/26/2025
7.1.8-beta 30 11/26/2025
7.1.7 32 10/06/2025
7.1.6 45 04/14/2025
7.1.5-alpha 36 04/14/2025
7.1.4 41 12/02/2024
7.1.4-preview 43 11/30/2024
7.1.3 41 11/19/2024
7.0.2 49 11/25/2024
7.0.1 43 11/28/2024
7.0.0 42 11/21/2024
7.0.0-rc3 41 11/25/2024
7.0.0-rc2 47 11/28/2024
7.0.0-rc1 44 11/30/2024
7.0.0-beta 43 01/01/2025
7.0.0-alpha 46 11/25/2024
6.4.2 44 05/29/2024
6.4.1 49 05/29/2024
6.4.0 46 05/29/2024
6.3.4 58 05/29/2024
6.3.4-rc 50 05/29/2024
6.3.4-beta 45 05/31/2024
6.3.3 46 05/29/2024
6.3.2 46 05/29/2024
6.3.0 57 05/29/2024
6.2.6 41 05/29/2024
6.2.5 50 05/29/2024
6.2.4 47 05/29/2024
6.2.3 47 05/29/2024
6.2.3-beta 49 05/31/2024
6.2.2 53 05/29/2024
6.2.1 45 05/29/2024
6.2.0 49 05/29/2024
6.1.1 51 05/29/2024
6.1.1-rc 43 05/29/2024
6.1.1-beta 53 05/31/2024
6.1.0 52 05/29/2024
6.0.5 53 05/29/2024
6.0.5-alpha 47 05/29/2024
6.0.4 50 05/29/2024
6.0.4-rc6 45 05/29/2024
6.0.4-rc5 49 05/29/2024
6.0.4-rc3 48 05/29/2024
6.0.4-rc 44 05/29/2024
6.0.4-beta 46 05/31/2024
6.0.4-alpha 49 05/29/2024
6.0.3 50 11/28/2024
6.0.2 45 05/29/2024
6.0.1 48 05/29/2024
5.1.2 42 05/29/2024
5.1.1 49 05/29/2024
5.1.0 48 05/29/2024
5.0.4 46 05/29/2024
5.0.3 50 05/29/2024
5.0.3-rc 49 05/29/2024
5.0.2-rc 48 05/29/2024
5.0.1 45 11/27/2024
4.0.2 46 05/29/2024
3.2.3 51 05/29/2024
3.2.1 52 05/29/2024
3.2.0 50 05/29/2024
3.0.1 54 05/29/2024
3.0.0 50 05/29/2024
2.0.3 47 05/29/2024
2.0.2 49 05/29/2024
2.0.1 55 05/29/2024
2.0.0 45 05/29/2024
1.1.0 51 05/29/2024
1.0.1 51 05/29/2024
1.0.0 51 05/29/2024