Git Product home page Git Product logo

Comments (2)

mike-marcacci avatar mike-marcacci commented on July 26, 2024

Hi @natesilva, this is a good question, and you are right that the lock command doesn't really need to be an EVAL. However, the unlock and extend commands really do need to, and given this, I made the lock script an eval for the sake of symmetry and maximum extensibility (since these are technically overrideable).

The reason that we need to use EVAL is because to safely release a lock, we need to atomically check the lock identity before deleting it (to make sure it is not owned by some other process). Currently, the only way to do this in redis is through lau scripts (as far as I know).

I have actually been in a similar situation myself, and would like to see EVAL added to fakeredis or a similar library. However, for my case (running automated tests) it proved to be easy enough to create new redis containers on-demand, which ultimately provides more representative results.

from node-redlock.

natesilva avatar natesilva commented on July 26, 2024

Thank you for the detailed explanation. It does sound like setting up some test or on-demand Redis instances is the best option, and we’ll look into that.

from node-redlock.

Related Issues (20)

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.