Registry / devops / hique
library1.1.4jsnpmunverified

hique is a job queue for Node.js, inspired by kue and bee-queue, focusing on stability and scalability. As of version 1.1.4, it provides a distributed job queue with a Monitor and Worker API, supporting job creation, processing, progress reporting, and child jobs. It uses an in-memory data store by default but allows custom stores. The package is maintained but has low activity, with no recent updates. Differentiators include stability over raw performance and easy horizontal scaling by adding worker processes.

npm install hique
INSTALL
IMPORT
SIG · HIQUE
H
hique
devopsjavascriptv1.1.4
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.

Monitor
import { Monitor } from 'hique'
const Monitor = require('hique').Monitor
ES6 import is preferred, but CommonJS require is also supported. Monitor is a named export.
Worker
import { Worker } from 'hique'
import Hique from 'hique'; new Hique.Worker()
Worker is a named export, not a property of a default export.
hique (default import)
import hique from 'hique'
const hique = require('hique')
Default export is an object containing Monitor and Worker, but named imports are recommended for clarity.

Creates a monitor and a worker, processes a job type 'email', and creates a sample job.

import { Monitor, Worker } from 'hique'; const monitor = new Monitor(); const worker = new Worker(); monitor.start(); worker.process('email', 2, (job, done) => { console.log(`Processing job ${job.id}`); done(null, job.data); }); worker.createJob('email', { to: 'user@example.com', subject: 'Hello' }, (job) => { console.log(`Job ${job.id} created`); }); worker.start();
Debug
Known issues
gotchaMonitor and Worker must be started explicitly (monitor.start() and worker.start()). Workers will not process jobs until worker.start() is called.
fix
Ensure you call .start() on both monitor and worker instances.
affects: >=1.0.0
gotchaThe default data store is in-memory and will not persist jobs across restarts. For production, a custom persistent store (e.g., Redis) is recommended.
fix
Implement a custom data store or use the built-in Redis store (requires 'redis' package).
affects: >=1.0.0
breakingIn version 1.0.0, the constructor signature of Worker changed from (options) to (options). Previously, Monitor was also required as first argument.
fix
Update Worker instantiation: new Worker(options) instead of new Worker(monitor, options).
affects: >=1.0.0
deprecatedThe 'job.reportProgress' method is deprecated and may be removed in future versions.
fix
Use a custom progress reporting mechanism instead, or update your implementation.
affects: >=1.0.0
gotchaJob type names are case-sensitive. Mismatched types in worker.process() and worker.createJob() will result in jobs not being processed.
fix
Always use the same string literal for job types.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: hq.Monitor is not a constructor
Importing the default export incorrectly, or using outdated CommonJS pattern.
fix
Use import { Monitor } from 'hique' or const { Monitor } = require('hique').
Error: listen EADDRINUSE :::3001
Monitor is already running on the same port (default 3001).
fix
Specify a different port in Monitor options, e.g., new Monitor({ port: 3002 }).
Error: job.ttl exceeded
Job processing took longer than the configured TTL (default 5 minutes).
fix
Increase job.ttl in Worker options or optimize job processing time.
Error: no processor for type 'myJob'
Worker does not have a process handler registered for the job type.
fix
Call worker.process('myJob', concurrency, handler) before creating jobs of that type.
Upgrade
Version history
1.1.4latest on npm
Audit
Dependencies
redisoptionalRequired for Redis data store, the most commonly used store for production.
Agent activity
10 hits · last 30 days
node
10
Resources
packagehique
hique — npm install hique · libregistry