Registry / devops / relyq
library0.13.0jsnpmunverified

A Redis-backed reliable task queue and state machine (v0.13.0). Built on four simple queues (todo, doing, failed, done) to ensure tasks are never lost on crash. Features blocking pop, cleanup options, defer support, and pluggable storage backends via subclasses like RedisJsonQ. Latest release: 2015, low maintenance cadence. Alternatives: Bull, Kue, Bee-Queue.

npm install relyq
INSTALL
IMPORT
SIG · RELYQ
R
relyq
devopsjavascriptv0.13.0
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.

Relyq
✓ const Relyq = require('relyq')
✗ import Relyq from 'relyq'
Package provides CommonJS exports; no ESM or default export.
RedisJsonQ
✓ const RedisJsonQ = require('relyq').RedisJsonQ
✗ const { RedisJsonQ } = require('relyq')
Named export via destructuring works in Node 6+ but .RedisJsonQ is also fine.
Queue object
✓ const q = new RedisJsonQ({ prefix: 'myq', createRedis: () => require('redis').createClient() })
✗ const q = new (require('relyq').RedisJsonQ)({ prefix: 'myq' })
Prefix and createRedis are required; omitting createRedis will cause runtime error.

Shows creation of a RedisJsonQ queue, pushing a task, and blocking process with finish.

const redis = require('redis'); const RedisJsonQ = require('relyq').RedisJsonQ; const q = new RedisJsonQ({ prefix: 'myqueue', createRedis: () => redis.createClient() }); // Push a task q.push({ id: 'task1', data: 'hello' }, (err, len) => { if (err) console.error(err); else console.log('Queue length:', len); }); // Process tasks q.bprocess(5, (err, task) => { if (err) return console.error(err); if (!task) return console.log('No task'); console.log('Processing:', task); // On success q.finish(task, (err) => { if (err) console.error(err); else console.log('Finished'); }); });
Debug
Known issues
deprecatedPassing redis client directly to constructor is deprecated; use createRedis option.
fix
Use new Q({ createRedis: () => redis.createClient() }) instead of new Q(redis, opts).
affects: >=0.12.0
gotchaPrefix and createRedis are required; omitting them causes silent failure or error.
fix
Always provide both prefix and createRedis in options object.
affects: >=0.12.0
gotchaTask IDs are auto-generated with uuid.v4() if missing; tasks must be objects.
fix
Pass objects with optional 'id' field; strings or numbers will be coerced but may cause errors.
affects: all
breakingRemoved .on('error') listener for unhandled errors; errors now emitted on queue object.
fix
Listen for 'error' event on the queue instance instead of globally.
affects: >=0.11.0
Errors
Common errors & fixes
TypeError: Cannot read property 'push' of undefined
Queue not instantiated because createRedis returned undefined or null.
fix
Ensure createRedis returns a valid Redis client: createRedis: () => redis.createClient()
Error: prefix is required
Missing 'prefix' option in queue constructor.
fix
Add prefix: 'myqueue' to options object.
TypeError: task.push is not a function
Attempted to push a non-object (e.g., string) into queue.
fix
Wrap data in an object: q.push({ id: '1', data: 'value' }, callback)
Upgrade
Version history
0.13.0latest on npm
Audit
Dependencies
redisrequiredRequired to create Redis clients for queue operations
uuidrequiredUsed to generate task IDs if not provided
Agent activity
4 hits · last 30 days
node
4
Resources
packagerelyq ↗
relyq — npm install relyq · libregistry