ioredis-timer

Ioredis Timer


Keywords
ioredis, redis, timer, timeout, typescript, javascript, js
License
MIT
Install
npm install ioredis-timer@1.0.0

Documentation

Build Status Coverage Status MIT license

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);