Metran 1.0.0
dotnet add package Metran --version 1.0.0
NuGet\Install-Package Metran -Version 1.0.0
<PackageReference Include="Metran" Version="1.0.0" />
paket add Metran --version 1.0.0
#r "nuget: Metran, 1.0.0"
// Install Metran as a Cake Addin #addin nuget:?package=Metran&version=1.0.0 // Install Metran as a Cake Tool #tool nuget:?package=Metran&version=1.0.0
Metran
Thread-safe transaction manager working in memory
Version
Version kept as low as possible to support older .NET versions
.NET 4.6 or higher
C# 7.0 or higher
What it does ?
Metran provides simple yet useful thread-safe locker
What is the goal ?
Goal is removing load from database or any other source and using ConcurrentBag to determine if given transaction id is processing
By using the "using" keyword you only have to BeginTransaction in metran container by providing an id
This way once you exit out of the method transaction will be automatically disposed and lock will be released
Metran does not do what "lock" keyword does. It does not lock current thread or any thread.
It's purpose is to lock certain users for instance calling same method/endpoint more than once.
Let's say you are going to do some financial database actions and you want user to be able to only call the method once. And if method is in processing you don't want second instance of the method running. Completely avoiding any overlap in db or any other business logic.
Remember this does NOT remove the need to use database transactions. It simply provides a locker with an id (in most cases user id or something else)
How to use ?
You can check the example project
WIP...
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6
- 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 |
---|---|---|
1.0.0 | 216 | 1/8/2024 |