ioredis-timer
v1.0.0
Published
Ioredis Timer
Downloads
4
Maintainers
Readme
Ioredis Timer
This module allows you do settimeout
in cluster mode.
Usage
import * as Redis from 'ioredis';
import { Timer } from 'ioredis-timer';
const redis = new Redis({
host: 'localhost',
port: 6379,
});
const timer = new Timer(redis);
timer.on('delivery', async id => {
console('do delevery here');
timer.finish('delivery', id);
});
timer.setTimeout('delivery', 1000);