{"repo":"mike-marcacci/node-redlock","free":true,"listed":false,"github":"https://github.com/mike-marcacci/node-redlock","clone":"git clone https://github.com/mike-marcacci/node-redlock.git","description":"A node.js redlock implementation for distributed, highly-available redis locks","language":"TypeScript","stars":1983,"topics":["redlock","redis-lock","redis","node"],"license":"MIT","category":"databases-storage","readme_excerpt":"Redlock This is a node.js implementation of the redlock algorithm for distributed redis locks. It provides strong guarantees in both single-redis and multi-redis environments, and provides fault tolerance through use of multiple independent redis instances or clusters. - Installation - Usage - Error Handling - API - Guidance Installation Configuration Redlock is designed to use ioredis to keep its client connections and handle the cluster protocols. A redlock object is instantiated with an array of at least one redis client and an optional options object. Properties of the Redlock object should NOT be changed after it is first used, as doing so could have unintended consequences for live locks. Usage The using method wraps and executes a routine in the context of an auto-extending lock, returning a promise of the routine's value. In the case that auto-extension fails, an AbortSignal will be updated to indicate that abortion of the routine is in order, and to pass along the encountered error. The first parameter is an array of resources to lock; the second is the requested lock duration in milliseconds, which MUST NOT contain values after the decimal. Alternatively, locks can be acquired and released directly: Use in CommonJS Projects Beginning in version 5, this package is published primarily as an ECMAScript module. While this is universally accepted as the format of the future, there remain some interoperability quirks when used in CommonJS node applications. For major vers","default_branch":null,"files":null,"tree":[],"storefront":"/r/mike-marcacci","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mike-marcacci/node-redlock/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}