Registry / messaging / ewd-qoper8

ewd-qoper8

JSON →
library3.18.1jsnpmunverified

ewd-qoper8 is a high-performance, memory-based message queue for Node.js, currently at version 3.18.1. It manages a pool of persistent child worker processes, each handling one message at a time, to prevent concurrent processing. The queue dispatches JSON messages to available workers, scaling worker count based on demand. Unlike general-purpose queues like Bull or Kue, ewd-qoper8 is designed for minimal overhead and is integrated with the ewd.js ecosystem. It supports customisation of master/worker logic and database connections. Release cadence is low; last stable release was in 2020.

npm install ewd-qoper8
INSTALL
IMPORT
SIG · EWD-QOPER8
E
ewd-qoper8
messagingjavascriptv3.18.1
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.

qoper8
const qoper8 = require('ewd-qoper8');
import qoper8 from 'ewd-qoper8';
ewd-qoper8 is CommonJS-only; no ESM wrapper. Always require().
QOper8
const { QOper8 } = require('ewd-qoper8');
const QOper8 = require('ewd-qoper8').default;
The main constructor is exported as an object property, not as default.
workerHandler
const { workerHandler } = require('ewd-qoper8');
const workerHandler = require('ewd-qoper8/workerHandler');
workerHandler is a named export; there is no separate module path.

Creates a QOper8 instance with a worker pool, starts it, and adds a message to the queue.

const qoper8 = require('ewd-qoper8'); const server = require('http').createServer(); const q = new qoper8.QOper8({ workerModule: './worker.js', poolSize: 2, maxPoolSize: 10 }); q.on('started', () => { console.log('QOper8 started'); q.addToQueue({ type: 'greet', data: 'Hello' }); }); q.start(); // worker.js: // module.exports = function(message, done) { // console.log('Received:', message); // done('processed'); // };
Debug
Known issues
breakingIn version 3.x, the callback signature for worker handler changed from (message, finish) to (message, done).
fix
Update worker handler to use done callback: `done(result)` instead of `finish(result)`.
affects: >=3.0.0 <3.0.0
deprecatedThe `maxPoolSize` option is deprecated in favor of `maxPool` since v3.2.
fix
Replace `maxPoolSize` with `maxPool` in constructor options.
affects: >=3.2.0
gotchaMessages must have a `type` property; otherwise, the queue will not process them and they may be silently dropped.
fix
Ensure every message object has a `type` field: `{ type: 'myType', ... }`.
affects: all
breakingIn version 3.0, the default worker module path resolution changed; relative paths are now resolved from the calling module, not the package root.
fix
Use an absolute path or path.resolve(__dirname, 'worker.js') for workerModule.
affects: >=3.0.0
gotchaWorker processes are spawned as child processes; they do not share memory with the master. All state must be passed via messages.
fix
Design workers to be stateless or use an external storage (e.g., database) for shared state.
affects: all
Errors
Common errors & fixes
Error: Cannot find module './worker.js'
Worker module path is relative and Node.js cannot resolve it from the expected directory.
fix
Use an absolute path: `workerModule: path.resolve(__dirname, 'worker.js')`
TypeError: message.type is undefined
Message added to queue lacks a `type` property.
fix
Add a `type` property to the message object: `q.addToQueue({ type: 'task', ... })`
qoper8.QOper8 is not a constructor
Using `import` syntax on a CommonJS module, or misreading the export.
fix
Use `const { QOper8 } = require('ewd-qoper8');`
Error: worker module must export a function
Worker file exports an object or other type instead of a function.
fix
Export a function: `module.exports = function(message, done) { ... }`
Upgrade
Version history
3.18.1latest on npm
Audit
Dependencies
ewd-utilsoptionalUsed for utility functions and logging.
Agent activity
22 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
ewd-qoper8 — npm install ewd-qoper8 · libregistry