Registry / messaging / fantastiq

fantastiq

JSON →
library2.1.0jsnpmunverified

A reliable job queue implementation on top of Redis, providing atomic operations, promises-based API (using Bluebird), built-in throttling, delayed jobs, multiple attempts, a REST API, and a web UI. Version 2.1.0 is the current stable release. Heavily inspired by Kue but with different semantics. Requires Redis >= 2.8.9.

npm install fantastiq
INSTALL
IMPORT
SIG · FANTASTIQ
F
fantastiq
messagingjavascriptv2.1.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.

fantastiq
const fantastiq = require('fantastiq');
import fantastiq from 'fantastiq';
This is a CommonJS module; no default ESM export is provided.
Queue
const queue = fantastiq({ host: '127.0.0.1' });
const queue = new fantastiq.Queue();
The factory function returns a Queue instance directly.
httpClient
const httpQueue = fantastiq.httpClient('http://example.com');
const httpQueue = require('fantastiq/httpClient');
httpClient is a static method on the main export.

Shows how to create a queue, process jobs, and add a job using the promise-based API.

const fantastiq = require('fantastiq'); const queue = fantastiq({ host: '127.0.0.1', port: 6379 }); queue.process(function (job) { console.log('Processing job:', job.id); return Promise.resolve(job.data); }); queue.add({ task: 'email', to: 'user@example.com' }) .then(function () { console.log('Job added'); }) .catch(function (err) { console.error('Failed to add job:', err); });
Debug
Known issues
gotchaThe `process` function does not automatically acknowledge jobs. You must return a promise from the handler; success/failure is inferred from resolution/rejection.
fix
Ensure your job handler returns a promise. If you use `retrieve`/`acknowledge` manually, call `queue.acknowledge(job.id, null, result)` on success or `queue.acknowledge(job.id, error)` on failure.
affects: >=2.0.0
gotchaWhen using `httpClient`, the remote server must expose the same API endpoints. There is no built-in authentication; secure the endpoint yourself.
fix
Ensure the HTTP server is behind a firewall or uses authentication middleware.
affects: >=2.0.0
deprecatedThe option `uniqueKey` is deprecated in favor of `unique` as a string. Using `uniqueKey` may cause unexpected behavior in future versions.
fix
Use `unique: '<key>'` instead of `uniqueKey: '<key>'`.
affects: >=2.0.0 <3.0.0
gotchaThe `add` method's `priority` option is not directly a number; it is a string like 'low', 'normal', 'medium', 'high', 'critical'. Using an arbitrary number may cause a crash.
fix
Use one of the predefined priority strings: 'low', 'normal', 'medium', 'high', 'critical'.
affects: >=1.0.0
breakingVersion 2.0.0 changed the `retrieve` signature: previously it returned an array of jobs, now it returns a single job object or null.
fix
Update code expecting an array: `const job = await queue.retrieve();` instead of `const jobs = await queue.retrieve(); const job = jobs[0];`.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis server is not running or not reachable.
fix
Start Redis server with `redis-server` or check connection settings.
TypeError: queue.process is not a function
Using newer ESM import syntax on a CommonJS module without proper default import.
fix
Use `const queue = require('fantastiq')(...);` or use dynamic import with `.default`.
Error: job acknowledgement failed: job not found
Attempting to acknowledge a job that has already been removed or expired.
fix
Check job ID or increase `removeCompletedAfter` configuration.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
bluebirdoptionalPromises library used internally and returned by the API
Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
fantastiq — npm install fantastiq · libregistry