{"repo":"swarthy/redis-semaphore","free":true,"listed":false,"github":"https://github.com/swarthy/redis-semaphore","clone":"git clone https://github.com/swarthy/redis-semaphore.git","description":"Distributed mutex and semaphore based on Redis","language":"TypeScript","stars":206,"topics":["semaphore","mutex","nodejs","redis"],"license":"MIT","category":"databases-storage","readme_excerpt":"redis-semaphore [![NPM version][npm-image]][npm-url] [![Build status][ci-image]][ci-url] ![FOSSA Status][typescript-image] [![Coverage Status][coverage-image]][coverage-url] [![Maintainability][codeclimate-image]][codeclimate-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![FOSSA Status][fossa-badge-image]][fossa-badge-url] Mutex and Semaphore implementations based on Redis ready for distributed systems Features - Fail-safe (all actions performed by LUA scripts (atomic)) Usage Installation ioredis is the officially supported Redis client. This library's test code runs on it. Users of other Redis clients should ensure ioredis-compatible API (see src/types.ts) when creating lock objects. Mutex See RedisLabs: Locks with timeouts new Mutex(redisClient, key [, { lockTimeout = 10000, acquireTimeout = 10000, acquireAttemptsLimit = Number.POSITIVE INFINITY, retryInterval = 10, refreshInterval = lockTimeout 0.8, identifier = crypto.randomUUID() }]) - redisClient - required , configured redis client - key - required , key for locking resource (final key in redis: mutex: ) - options - optional - lockTimeout - optional ms, time after mutex will be auto released (expired) - acquireTimeout - optional ms, max timeout for .acquire() call - acquireAttemptsLimit - optional max number of attempts to be made in .acquire() call - retryInterval - optional ms, time between acquire attempts if resource locked - refreshInterval - optional ms, auto-refresh interval; to disable auto-refresh beh","default_branch":null,"files":null,"tree":[],"storefront":"/r/swarthy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/swarthy/redis-semaphore/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."}