1.0.0 • Published 5 years ago

ioredis-timer v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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