mutexes for node.js, powered by redis
pass an already instantiated redis client to the constructor, you can then use the
'use strict';const Redis = ;const Mutis = ;const client = Redis;const mutex = client;mutex;
mutis will wait for the lock to be available before returning, by the time your
.then() is called your lock is acquired.
you can pass a second argument to
.lock() to be used as a timeout, for example:
for additional usage examples, see the tests