Rystem.Concurrency 9.0.19

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rystem.Concurrency --version 9.0.19
                    
NuGet\Install-Package Rystem.Concurrency -Version 9.0.19
                    
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.0.19" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rystem.Concurrency" Version="9.0.19" />
                    
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.0.19
                    
#r "nuget: Rystem.Concurrency, 9.0.19"
                    
#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.0.19
                    
#: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.0.19
                    
Install as a Cake Addin
#tool nuget:?package=Rystem.Concurrency&version=9.0.19
                    
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.2 276,866 5/29/2025
9.1.1 97,856 5/2/2025
9.0.32 186,594 4/15/2025
9.0.31 5,776 4/2/2025
9.0.30 88,771 3/26/2025
9.0.29 8,964 3/18/2025
9.0.28 198 3/17/2025
9.0.27 188 3/16/2025
9.0.26 203 3/13/2025
9.0.25 52,056 3/9/2025
9.0.23 162 3/9/2025
9.0.21 658 3/6/2025
9.0.20 19,523 3/6/2025
9.0.19 265 3/6/2025
9.0.18 258 3/4/2025
9.0.17 151 3/1/2025
9.0.16 147 3/1/2025
9.0.15 75,513 2/22/2025
9.0.14 22,558 2/18/2025
9.0.13 166 2/9/2025
9.0.12 217,831 1/13/2025
9.0.11 23,996 1/9/2025
9.0.10 118 1/9/2025
9.0.9 4,012 1/7/2025
9.0.8 12,493 1/6/2025
9.0.7 145 1/6/2025
9.0.5 19,093 12/30/2024
9.0.4 92,309 12/23/2024
9.0.3 154 12/22/2024
9.0.2 10,706 12/21/2024
9.0.1 1,192 12/21/2024
9.0.0 173,022 11/16/2024
9.0.0-rc.1 122 10/18/2024
6.2.0 220,199 10/9/2024
6.1.1 170 10/9/2024
6.1.0 47,947 9/29/2024
6.0.24 223 9/11/2024
6.0.23 340,101 7/18/2024
6.0.21 200 6/18/2024
6.0.20 727,858 6/16/2024
6.0.19 30,440 6/14/2024
6.0.18 180 6/14/2024
6.0.17 196 6/14/2024
6.0.16 50,024 6/10/2024
6.0.15 196 6/9/2024
6.0.14 201 5/24/2024
6.0.13 181 5/23/2024
6.0.12 183 5/23/2024
6.0.11 187 5/20/2024
6.0.9 183 5/19/2024
6.0.7 160 5/18/2024
6.0.6 187 5/10/2024
6.0.5 190 5/10/2024
6.0.4 211 4/3/2024
6.0.3 1,603 3/25/2024
6.0.2 3,719 3/11/2024
6.0.1 171 3/8/2024
6.0.0 396 11/21/2023
6.0.0-rc.6 134 10/25/2023
6.0.0-rc.5 102 10/25/2023
6.0.0-rc.4 94 10/23/2023
6.0.0-rc.3 95 10/19/2023
6.0.0-rc.2 107 10/18/2023
6.0.0-rc.1 112 10/16/2023
5.0.20 560 9/25/2023
5.0.19 1,149 9/10/2023
5.0.18 398 9/6/2023
5.0.17 380 9/6/2023
5.0.16 356 9/5/2023
5.0.15 369 9/5/2023
5.0.14 395 9/5/2023
5.0.13 493 9/1/2023
5.0.12 353 8/31/2023
5.0.11 384 8/30/2023
5.0.10 387 8/29/2023
5.0.9 382 8/24/2023
5.0.8 377 8/24/2023
5.0.7 370 8/23/2023
5.0.6 370 8/21/2023
5.0.5 389 8/21/2023
5.0.4 402 8/16/2023
5.0.3 461 8/2/2023
5.0.2 410 8/2/2023
5.0.1 447 8/1/2023
5.0.0 448 7/31/2023
4.1.26 788 7/20/2023
4.1.25 426 7/16/2023
4.1.24 635 6/13/2023
4.1.23 448 6/13/2023
4.1.22 444 5/30/2023
4.1.21 458 5/20/2023
4.1.20 315,653 4/19/2023
4.1.19 95,239 3/20/2023
4.1.18 528 3/20/2023
4.1.17 527 3/16/2023
4.1.16 556 3/16/2023
4.1.15 990 3/15/2023
4.1.14 2,231 3/9/2023
4.1.13 563 3/7/2023
4.1.12 594 2/9/2023
4.1.11 609 1/26/2023
4.1.10 614 1/22/2023
4.1.9 620 1/20/2023
4.1.8 618 1/18/2023
4.1.7 646 1/18/2023
4.1.6 605 1/17/2023
4.1.1 590 1/4/2023
4.1.0 604 12/30/2022
3.0.25 785 12/21/2022
3.0.24 849 11/18/2022
3.0.23 827 11/18/2022
3.0.22 870 11/15/2022
3.0.21 853 11/14/2022
3.0.20 825 11/13/2022
3.0.19 861 11/2/2022
3.0.18 886 11/2/2022
3.0.17 910 10/29/2022
3.0.16 904 10/29/2022
3.0.15 921 10/29/2022
2.0.6 971 9/20/2022
2.0.5 1,229 9/20/2022
2.0.4 974 9/20/2022
2.0.3 546 9/20/2022
2.0.1 1,060 9/13/2022
2.0.0 890 8/19/2022
1.1.24 1,137 7/30/2022
1.1.23 995 7/29/2022
1.1.22 545 7/29/2022
1.1.21 975 7/29/2022
1.1.20 1,007 7/29/2022
1.1.19 1,046 7/27/2022
1.1.17 997 7/27/2022
1.1.16 556 7/26/2022
1.1.15 1,010 7/25/2022
1.1.14 1,012 7/25/2022
1.1.13 1,004 7/22/2022
1.1.12 997 7/19/2022
1.1.11 1,031 7/19/2022
1.1.10 1,014 7/19/2022
1.1.9 1,026 7/19/2022
1.1.8 1,017 7/18/2022
1.1.7 1,036 7/18/2022
1.1.6 1,019 7/18/2022
1.0.5 577 7/17/2022
1.0.4 1,012 7/17/2022
1.0.2 1,063 7/17/2022
1.0.1 540 7/12/2022
1.0.0 1,591 7/8/2022
0.10.7 1,084 7/8/2022
0.9.12 1,017 6/30/2022
0.9.11 984 6/29/2022
0.9.10 1,048 6/28/2022
0.9.9 566 6/27/2022