hxnodejs-redislock

Externs for the redislock NPM module


Keywords
db, js, nodejs, redis
License
MIT
Install
haxelib install hxnodejs-redislock 1.2.1

Documentation

Haxe/hxnodejs externs for the redislock npm library

Tested using redislock version 1.2.0

Example:

import js.npm.Redislock;

var client = js.npm.Redis.createClient();
var lock = RedisLock.acquire(client, {
  timeout: 20000,
  retries: 3,
  delay: 100
});

lock.acquire('app:feature:lock', function(err) {
  // if (err != null) failed to acquire lock
  
  lock.release(function(err) {
    // if (err != null) failed to release lock
  });
}