Registry / messaging / node-redis-queue

node-redis-queue

JSON →
library0.2.5jsnpmunverified

A lightweight queueing wrapper for Redis using lpush/brpop, providing Channel (push/pop) and WorkQueueMgr (send/consume) interfaces for inter-process communication. Version 0.2.5 (last released around 2014) is stable but unmaintained; no releases in the last decade. Differentiators: simple synchronous blocking pop with timeout, full-duplex mode via two Redis connections to avoid hangs, and tunable concurrency (arity) for consumption. Alternatives with active maintenance include Bull, BullMQ, and Bee-Queue.

npm install node-redis-queue
INSTALL
IMPORT
SIG · NODE-REDIS-QUEUE
N
node-redis-queue
messagingjavascriptv0.2.5
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.

Channel
import { Channel } from 'node-redis-queue';
const Channel = require('node-redis-queue').Channel;
Library uses CommonJS internally; ESM import works as named export.
WorkQueueMgr
import { WorkQueueMgr } from 'node-redis-queue';
const workQueue = require('node-redis-queue');
WorkQueueMgr is a named export, not the default.
WorkQueue
import { WorkQueue } from 'node-redis-queue';
Also a named export; typically instantiated via WorkQueueMgr, but can be imported directly.

Demonstrates basic Channel push/pop with blocking and timeout variants. Note: pop blocks indefinitely; use full-duplex mode (connect2) to avoid hangs when concurrent pops exist.

import { Channel } from 'node-redis-queue'; const channel = new Channel(); channel.connect(() => { // Push a message channel.push('myQueue', JSON.stringify({ hello: 'world' })); // Pop a message (blocks until one is available) channel.pop('myQueue', (data) => { console.log('Received:', data); }); }); // With timeout (10 seconds) channel.popTimeout('myQueue', 10, (data) => { if (data) console.log('Received:', data); else console.log('Timeout'); });
Debug
Known issues
gotchaThe package is effectively abandoned (last release 2014, no commits since). It does not support modern Redis versions or features like IRedis client (ioredis).
fix
Migrate to actively maintained alternatives like Bull, BullMQ, or Bee-Queue.
affects: >=0.0.0
gotchaThe pop() method blocks indefinitely (using brpop with no timeout). This can hang your application if no data arrives. Use popTimeout() instead.
fix
Always specify a timeout via popTimeout() or consume() with a timeout option.
affects: >=0.0.0
gotchaThe library exposes the underlying Redis client (channel.client). Modifying it directly may break queue behavior (e.g., closing the connection).
fix
Avoid direct manipulation of channel.client; use provided methods only.
affects: >=0.0.0
gotchaIn single-connection mode (connect), a long-running pop/consume can block push operations because both use the same Redis client. Use full-duplex mode (connect2) to avoid this.
fix
Call connect2() instead of connect() to use separate connections for push and pop.
affects: >=0.0.0
gotchaThe package does not handle reconnection or Redis connection failures gracefully. The client may become stale without notification.
fix
Implement external reconnection logic or switch to a library with built-in reconnection support.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis server is not running or unreachable.
fix
Start Redis: redis-server, or check connection config (defaults to localhost:6379).
TypeError: channel.pop is not a function
Channel not properly connected before calling methods.
fix
Ensure you call connect() or attach() with valid Redis clients before using push/pop.
Error: The CONFIG option is not set (path: /path/to/config.json). Use environment variable QUEUE_CONFIG_PATH or pass config path to constructor.
No configuration file found and no path provided.
fix
Pass config file path to constructor or set QUEUE_CONFIG_PATH environment variable.
Upgrade
Version history
0.2.5latest on npm
Audit
Dependencies
redisrequiredRequired to connect to Redis server; the library wraps redis client operations (lpush, brpop, etc.)
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
node-redis-queue — npm install node-redis-queue · libregistry