GithubHelp home page GithubHelp logo

lazylock's Introduction

lazyLock

lazyLock go implementation

Go codecov Release Go Report Card Go Reference License: MIT

Description

lazyLock is great for business scenarios. When writing business-specific code, there may not be too many concurrent operations on a resource/scenario, so you don't want to hold a mutex for them, but you're worried about concurrent operations on it. Using lazyLock, it provides the ability to guarantee mutually exclusive operations when a conflict occurs, and to automatically release resources when the conflict disappears.

For example: most of the characteristics of the website access data in the "law of two or eight": 80% of the business access is concentrated in 20% of the data. We can use lazyLock to lock the data where the hot access occurs, without paying attention to the other 80% of the cold data.

English | 简体中文

Example use:

package main

import "github.com/me-cs/lazyLock"

func main() {

	unlock := lazyLock.Lock("key")

	//Your code that needs to be protected

	unlock()

}

lazylock's People

Contributors

me-cs avatar

Watchers

 avatar

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.