Registry / backend / timed-queue

timed-queue

JSON →
library1.4.0jsnpmunverified

Distributed timed job queue backed by Redis. Version 1.4.0 is current stable, last updated in 2019. It supports Redis cluster, multiple queues with prefix segregation, automatic scanning, retry and expiration of jobs. Key differentiators: designed for Node.js 6+, uses thunk-redis (callback/promise based, not modern async/await), and provides EventEmitter events for connection lifecycle and scan progress. It is a niche, low-maintenance library suitable for simple timed job scenarios but may lack modern features like persistence or advanced scheduling compared to Bull/BullMQ.

backend
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

No ESM export; CommonJS only

const TimedQueue = require('timed-queue')

queue is a method, not a constructor or static

const q = timedQueue.queue('myqueue')

addjob returns a thunk, not a Promise; call with callback or use thunkify

queue.addjob('jobId', timestamp)(callback)

Initializes a timed queue, creates a queue named 'event', listens for jobs, and adds a job.

const TimedQueue = require('timed-queue'); const timedQueue = new TimedQueue({ prefix: 'TQ1', interval: 1000 * 60 }); timedQueue.connect() .on('connect', () => { const eventQueue = timedQueue.queue('event'); eventQueue.on('job', (jobObj) => { console.log('Processing job:', jobObj.job); eventQueue.ackjob(jobObj.job)(); }); // Add a job to execute 10 minutes before event start const eventStart = new Date('2025-06-01T10:00:00Z').getTime(); eventQueue.addjob('event123', eventStart - 10 * 60 * 1000)((err) => { if (err) console.error(err); else console.log('Job added'); }); }) .on('error', console.error);
Debug
Known footguns
gotchatimed-queue uses thunk-redis which is callback-based; addjob and ackjob return thunks (functions expecting a callback), not Promises. Using .then() will cause a runtime error.
breakingNode.js version requirement is >=6, which is end-of-life. The package may not work on Node.js 18+ as thunk-redis uses deprecated APIs.
deprecatedThe package has not been updated since 2019. It is effectively in maintenance mode with no new features or bug fixes.
gotchaDefault options (interval: 60000, retry: 30000, expire: 300000) may be too slow for high-frequency jobs. Jobs are only polled every 60 seconds by default.
gotchaThe queue method returns a Queue instance, not a string. Calling timedQueue.queue('name') repeatedly for the same name returns the same instance.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
18 hits · last 30 days
gptbot
3
petalbot
2
bytedance
2
ahrefsbot
1
Resources