A debounce function for distributed systems using Redis and Node.js. Current version 1.0.9, with no regular release cadence. It differs from client-side debounce by coordinating across multiple processes or servers via Redis, ensuring only the last invocation in a distributed environment executes the callback. Uses an atomic INCR + EXPIRE pattern for unique tickets and Redis locks for mutual exclusion. Ships TypeScript types and supports Redis clusters. Requires Node >= 10.12.0 and Redis >= 2.x as a peer dependency. Not actively maintained (last update 2019).
npm install node-distributed-debounceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates distributed debounce with a Redis client, invoking the callback only for the last call in a burst across 1 second.
Specify wait as number of seconds (e.g., 5 for 5 seconds).
Always attach a .catch() or use await with try/catch.
Consider using ioredis with a wrapper, or stay with redis@2.x. Check compatibility before upgrading Redis client.
Use a unique prefix for your debounce keys (e.g., 'dist-debounce:').
For critical applications, consider using Redis with sentinel or cluster mode, and implement fallback mechanisms.
Ensure Redis is running: 'redis-server' or provide correct URL via REDIS_URL env variable.
Use 'import redis from 'redis'' or 'const redis = require('redis')' and then 'redis.createClient()'.Use correct named import: 'import { distributedDebounce } from 'node-distributed-debounce''.Run 'npm install redis' to install the required peer dependency.