A Node.js library (v1.0.0) that uses Redis keyspace notifications to trigger timed events. Inspired by Codezuki's blog post, it allows scheduling, rescheduling, and cancelling events with multiple handlers per key. Requires Redis 2.8+ with keyspace notifications enabled (notify-keyspace-events Ex). Unlike typical job queues, it leverages Redis' native expiry mechanism. Stable but not actively maintained; last release was several years ago. Suitable for simple timer-based tasks but not for high-throughput or persistent job queues.
npm install redis-schedulerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a redis-scheduler instance, schedules an event with a 2-second delay, and closes the scheduler after 5 seconds.
Set notify-keyspace-events Ex in redis.conf or via CONFIG SET notify-keyspace-events Ex.
Upgrade Redis to version 2.8.0 or later.
Pin the 'redis' dependency version to avoid incompatibilities.
Use distinct keys for different events to prevent accidental cross-cleanup.
Run 'redis-cli config set notify-keyspace-events Ex' or set it in redis.conf.
Use require('redis-scheduler') as CommonJS; ensure the package is installed correctly.Pass a valid number of milliseconds or a Date object to expire.