New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lockredis

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lockredis

Simple locking utility on top of Redis

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

lockredis

Barebones locking utility for Redis. Uses the algorithm described in Redis Documentation.

install

npm install lockredis

usage

var lockredis = require('lockredis');
var locker = lockredis(redis.createClient());

locker('lockname', {
	timeout: 5000, // Time for a lock to expire on its own in milliseconds
	retries: Infinity, // Number of retries in case the lock is already acquired
	retryDelay: 250 // Time between retry attempts in milliseconds
}, function(err, done) {
	if (err) {
		// Lock could not be acquired for some reason.
	}

	// do stuff...

	done() // release lock
});

license

MIT

Keywords

redis

FAQs

Package last updated on 01 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts