Simple locking utility on top of Redis
Barebones locking utility for Redis. Uses the algorithm described in Redis Documentation.
npm install lockredis
var lockredis = require'lockredis';var locker = lockredisrediscreateClient;locker'lockname'timeout: 5000 // Time for a lock to expire on its own in millisecondsretries: Infinity // Number of retries in case the lock is already acquiredretryDelay: 250 // Time between retry attempts in millisecondsif err// Lock could not be acquired for some reason.// do stuff...done // release lock;