Registry / devops / qued
library0.0.10jsnpmunverified

A simple worker queue for Node.js, inspired by kue and intended as a drop-in replacement. Version 0.0.10 (infrequent releases). It uses Redis for storage, processes one job at a time, and avoids extra queues (no completed or error queues) for simplicity. Key differentiator: minimalistic design with fewer moving parts compared to kue or bull, but lacks advanced features like priority, retries, or job scheduling.

npm install qued
INSTALL
IMPORT
SIG · QUED
Q
qued
devopsjavascriptv0.0.10
harness data pending
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.

default
import Qued from 'qued'
const Qued = require('qued')
ESM import supported; CJS require also works.
Qued
const { default: Qued } = require('qued')
const Qued = require('qued').default
In CJS, default export is accessed via require('qued').default (TypeScript with esModuleInterop may handle automatically).
Qued
import Qued from 'qued'
import { Qued } from 'qued'
Named import is incorrect; Qued is the default export.

Shows basic setup with Redis connection, creating a consumer job, and processing jobs with a worker.

import Qued from 'qued'; const qued = new Qued({ REDIS_HOSTNAME: 'localhost', REDIS_PORT: 6379, REDIS_PASSWORD: null, TIMEOUT: 0 // no timeout }); // Consumer: create jobs const consumer = qued.createConsumer(); consumer.create('email', { to: 'user@example.com', subject: 'Hello' }).save((err) => { if (err) console.error(err); else console.log('Job created'); }); // Worker: process jobs qued.addProcess('email', (job, done) => { console.log('Sending email to', job.data.to); setTimeout(done, 100); }); const worker = qued.createWorker(); worker.start();
Debug
Known issues
gotchaTIMEOUT setting: if set to 0, no timeout; otherwise, job must call done() within timeout milliseconds, else worker will crash.
fix
Set TIMEOUT to 0 unless you have poorly written jobs; otherwise ensure jobs always call done().
affects: >=0.0.1
gotchaWorker processes one job at a time: qued is designed for sequential execution; concurrent job processing is not supported.
fix
If you need parallelism, consider using multiple worker processes or another queue library (e.g., bull).
affects: >=0.0.1
gotchaNo persistent queues for completed or failed jobs; once a job is processed, it is removed from Redis.
fix
If you need job history, implement your own logging or switch to kue/bull.
affects: >=0.0.1
gotchaRedis connection settings are all uppercase with underscores; typos like 'REDIS_HOST' instead of 'REDIS_HOSTNAME' will cause connection failures.
fix
Use exact keys: REDIS_HOSTNAME, REDIS_PORT, REDIS_PASSWORD.
affects: >=0.0.1
gotchaThe shutdown function only ensures the last job finishes; it does not prevent new jobs from being queued. You must stop the consumer separately.
fix
Call worker.shutdown() after stopping the consumer to avoid processing new jobs after shutdown.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED
Redis server is not running or not accessible at the given host/port.
fix
Start Redis server: redis-server (or check if Redis is installed and running).
TypeError: qued.createConsumer is not a function
Using an outdated version (<0.0.4?) or incorrect import (maybe using Qued class directly without 'new').
fix
Ensure you are using version >=0.0.4 and instantiate Qued with 'new Qued(...)' before calling createConsumer.
Error: Job timed out
TIMEOUT set to a positive value and the job did not call done() within that time.
fix
Increase TIMEOUT or set to 0 (no timeout). Ensure your job logic calls done().
TypeError: job.data is undefined
The job object passed to the process handler does not have a data property, possible because the job was created without data.
fix
When creating job, ensure data is passed: consumer.create('type', {foo: 'bar'}).
Upgrade
Version history
0.0.10latest on npm
Audit
Dependencies
redisrequiredRequires Redis for queue storage
Agent activity
2 hits · last 30 days
node
2
Resources
packagequed
qued — npm install qued · libregistry