Rystem.Concurrency 9.1.3

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

What is Rystem?

Concurrency

Async Lock

A lock keyword is used in C# to lock a memory address to have a sort of execution queue. But, unfortunately, you cannot use async methods in the lock statement. With async lock you also may have the lock behavior for your async methods. In DI you have to add the lock service

services.AddLock();

Inject ILock and use it

ILock locking = _serviceProvider.CreateScope().ServiceProvider.GetService<ILock>();
await locking!.ExecuteAsync(() => CountAsync(2), "SampleKey");

You have the method to execute, a key for more than one concurrent lock.

Race condition

First of all, you have to understand the race condition here In DI you have to add the lock service

services.AddRaceCondition();

Inject IRaceCodition and use it

 var raceCondition = _serviceProvider.CreateScope().ServiceProvider.GetService<IRaceCodition>();
 raceCondition!.ExecuteAsync(() => CountAsync(2), (i % 2).ToString(), TimeSpan.FromSeconds(2));

You have the method to execute, a key for more than one concurrent race, and a time span for time window, if you put 2 seconds, you block the execution of further methods for 2 seconds from when first method started.

ILockable

You can inject the ILockable interface for your purpose, like a distributed lock with Blob storage, or redis cache for instance.

services.AddLockableIntegration<BlobLockIntegration>();
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 (3)

Showing the top 3 NuGet packages that depend on Rystem.Concurrency:

Package Downloads
Rystem.Test.XUnit

Rystem is a open-source framework to improve the System namespace in .Net

Rystem.BackgroundJob

Rystem.

Rystem.Concurrency.Redis

Rystem.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.1.3 212 9/2/2025
9.1.2 607,161 5/29/2025
9.1.1 97,887 5/2/2025
9.0.32 186,623 4/15/2025
9.0.31 5,805 4/2/2025
9.0.30 88,796 3/26/2025
9.0.29 8,993 3/18/2025
9.0.28 227 3/17/2025
9.0.27 220 3/16/2025
9.0.26 235 3/13/2025
9.0.25 52,088 3/9/2025
9.0.23 187 3/9/2025
9.0.21 688 3/6/2025
9.0.20 19,541 3/6/2025
9.0.19 293 3/6/2025
9.0.18 289 3/4/2025
9.0.17 182 3/1/2025
9.0.16 178 3/1/2025
9.0.15 75,544 2/22/2025
9.0.14 22,590 2/18/2025
9.0.13 198 2/9/2025
9.0.12 217,862 1/13/2025
9.0.11 24,024 1/9/2025
9.0.10 144 1/9/2025
9.0.9 4,043 1/7/2025
9.0.8 12,523 1/6/2025
9.0.7 173 1/6/2025
9.0.5 19,119 12/30/2024
9.0.4 92,337 12/23/2024
9.0.3 183 12/22/2024
9.0.2 10,738 12/21/2024
9.0.1 1,223 12/21/2024
9.0.0 173,058 11/16/2024
9.0.0-rc.1 127 10/18/2024
6.2.0 220,450 10/9/2024
6.1.1 201 10/9/2024
6.1.0 47,980 9/29/2024
6.0.24 246 9/11/2024
6.0.23 340,133 7/18/2024
6.0.21 223 6/18/2024
6.0.20 727,891 6/16/2024
6.0.19 30,474 6/14/2024
6.0.18 212 6/14/2024
6.0.17 229 6/14/2024
6.0.16 50,055 6/10/2024
6.0.15 228 6/9/2024
6.0.14 229 5/24/2024
6.0.13 211 5/23/2024
6.0.12 197 5/23/2024
6.0.11 211 5/20/2024
6.0.9 213 5/19/2024
6.0.7 186 5/18/2024
6.0.6 225 5/10/2024
6.0.5 218 5/10/2024
6.0.4 241 4/3/2024
6.0.3 1,635 3/25/2024
6.0.2 3,753 3/11/2024
6.0.1 201 3/8/2024
6.0.0 415 11/21/2023
6.0.0-rc.6 139 10/25/2023
6.0.0-rc.5 106 10/25/2023
6.0.0-rc.4 99 10/23/2023
6.0.0-rc.3 100 10/19/2023
6.0.0-rc.2 113 10/18/2023
6.0.0-rc.1 116 10/16/2023
5.0.20 570 9/25/2023
5.0.19 1,173 9/10/2023
5.0.18 424 9/6/2023
5.0.17 406 9/6/2023
5.0.16 382 9/5/2023
5.0.15 395 9/5/2023
5.0.14 421 9/5/2023
5.0.13 520 9/1/2023
5.0.12 379 8/31/2023
5.0.11 411 8/30/2023
5.0.10 412 8/29/2023
5.0.9 410 8/24/2023
5.0.8 407 8/24/2023
5.0.7 398 8/23/2023
5.0.6 397 8/21/2023
5.0.5 417 8/21/2023
5.0.4 429 8/16/2023
5.0.3 480 8/2/2023
5.0.2 438 8/2/2023
5.0.1 476 8/1/2023
5.0.0 476 7/31/2023
4.1.26 833 7/20/2023
4.1.25 453 7/16/2023
4.1.24 666 6/13/2023
4.1.23 477 6/13/2023
4.1.22 472 5/30/2023
4.1.21 487 5/20/2023
4.1.20 315,683 4/19/2023
4.1.19 95,270 3/20/2023
4.1.18 549 3/20/2023
4.1.17 556 3/16/2023
4.1.16 585 3/16/2023
4.1.15 1,021 3/15/2023
4.1.14 2,260 3/9/2023
4.1.13 584 3/7/2023
4.1.12 625 2/9/2023
4.1.11 641 1/26/2023
4.1.10 635 1/22/2023
4.1.9 650 1/20/2023
4.1.8 649 1/18/2023
4.1.7 676 1/18/2023
4.1.6 630 1/17/2023
4.1.1 614 1/4/2023
4.1.0 635 12/30/2022
3.0.25 821 12/21/2022
3.0.24 882 11/18/2022
3.0.23 859 11/18/2022
3.0.22 902 11/15/2022
3.0.21 887 11/14/2022
3.0.20 860 11/13/2022
3.0.19 886 11/2/2022
3.0.18 920 11/2/2022
3.0.17 942 10/29/2022
3.0.16 939 10/29/2022
3.0.15 950 10/29/2022
2.0.6 1,006 9/20/2022
2.0.5 1,251 9/20/2022
2.0.4 1,007 9/20/2022
2.0.3 564 9/20/2022
2.0.1 1,096 9/13/2022
2.0.0 918 8/19/2022
1.1.24 1,170 7/30/2022
1.1.23 1,029 7/29/2022
1.1.22 572 7/29/2022
1.1.21 1,009 7/29/2022
1.1.20 1,030 7/29/2022
1.1.19 1,080 7/27/2022
1.1.17 1,030 7/27/2022
1.1.16 596 7/26/2022
1.1.15 1,028 7/25/2022
1.1.14 1,047 7/25/2022
1.1.13 1,039 7/22/2022
1.1.12 1,030 7/19/2022
1.1.11 1,064 7/19/2022
1.1.10 1,036 7/19/2022
1.1.9 1,056 7/19/2022
1.1.8 1,052 7/18/2022
1.1.7 1,071 7/18/2022
1.1.6 1,052 7/18/2022
1.0.5 606 7/17/2022
1.0.4 1,034 7/17/2022
1.0.2 1,092 7/17/2022
1.0.1 566 7/12/2022
1.0.0 1,636 7/8/2022
0.10.7 1,117 7/8/2022
0.9.12 1,052 6/30/2022
0.9.11 1,019 6/29/2022
0.9.10 1,083 6/28/2022
0.9.9 593 6/27/2022