GithubHelp home page GithubHelp logo

turhany / monolithicsync Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 67 KB

MonolithicSync is a simple lock management library for .NET monolithic applications.

License: GNU General Public License v3.0

C# 100.00%
lock syncronizer

monolithicsync's Introduction

alt tag

MonolithicSync is a simple lock management library for .NET monolithic applications.

NuGet version Nuget

Features:

  • Single key lock / async lock
  • Multiple key lock / async lock
  • Single key release
  • Multiple key release
  • Can group locks
  • Can relase locks with group key

Usages:


DI Registration:

  public void ConfigureServices(IServiceCollection services)
  {
      services.AddScoped<IMonolithicSync, MonolithicSync.Concrete.MonolithicSync>();
  }

Lock/Release:

  public void BestWayToUse()
  {
      var groupKey = "group1";
      var lockKey = "key";

      if (!_monolithicSync.Lock(groupKey, lockKey))
      {
          throw new Exception(String.Format(MonolithicSync.Helpers.MonolithicSyncConstants.LockFailMessage, $"{groupKey}-{lockKey}"));
      }

      try
      {
          //do something
      }
      catch (Exception e)
      {
          Console.WriteLine(e);
          throw;
      }
      finally
      {
          _monolithicSync.Release(groupKey, lockKey);
      }
  }

Release Notes

1.0.4

  • Async Lock methods added.

1.0.3

  • Relase by Group Key bug fixed.

1.0.2

  • Base Release (deprecated)

1.0.0 - 1.0.1

  • Broken releases (deprecated)

monolithicsync's People

Contributors

turhany avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

monolithicsync's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.