Distributed timer backed by Redis for clustered server environments. Version 0.3.3 (stable; low release cadence). Replaces unreliable setTimeout() with persistent timed events stored in Redis, supporting round-robin distribution across multiple listeners via pubsub. Requires Redis 2.6.0+ and promisified redis client (bluebird). Key differentiator: low-latency notification and retry mechanism via confirmation timeout.
npm install dtimerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a DTimer instance, listen for events, post an event with 5s delay, and confirm processing.
Call Promise.promisifyAll(redis) before creating clients.
Omit callback argument and use .then() / async-await.
Nest user data under a property like 'data' to avoid collision.
Set maxEvents before join() or leave() and rejoin.
Always call timer.confirm(ev.id) in event handler.
Ensure confirm() is called within handler and confTimeout is sufficient.
Add: const Promise = require('bluebird'); Promise.promisifyAll(require('redis'));Check that confirm() is called and confTimeout is not too short.
Use: const { DTimer } = require('dtimer') or import DTimer from 'dtimer'.