smooch-bot-redis
v1.0.0
Published
Redis state lock for smooch/smooch-bot
Downloads
3
Readme
Smooch Bot Redis
A state lock using redis, for use with smooch-bot
var RedisLock = require('smooch-bot-redis').RedisLock;
var lock = new RedisLock();
lock.acquireLock('foo').then((acquired) => {
if (acquired) {
return lock.releaseLock('foo');
}
});
Options
A Redis client is required. An existing client can be passed directly using the client
param or created for you using the host
, port
, or socket
params.
client
An existing clienthost
Redis server hostnameport
Redis server portnosocket
Redis server unix_socketurl
Redis server urlpass
Password for Redis authentication
For example:
var RedisLock = require('smooch-bot-redis').RedisLock;
var lock = new RedisLock({
host: 'localhost',
port: 6379,
});