Registry / testing / in-memory-queue

in-memory-queue

JSON →
library1.0.3jsnpmunverified

Simple in-memory job queue for Node.js (version 1.0.3, last updated 2018). It supports concurrent read/writes, retry mechanisms, parallel and series processing based on consumer priority, multiple consumers per topic, and topic-wise job distribution. Unlike Redis-backed queues (Bull, Bee), it has zero external dependencies and runs entirely in-process with no persistence. Key differentiators: consumer priority scheduling (lower priority numbers run first and in parallel), built-in retry, and promise-based API.

npm install in-memory-queue
INSTALL
IMPORT
SIG · IN-MEMORY-QUEUE
I
in-memory-queue
testingjavascriptv1.0.3
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.

default
const imqueue = require('in-memory-queue');
import imqueue from 'in-memory-queue';
Package is CommonJS only (no ESM). Do not use ES import syntax.

Shows basic usage: configure queue, create topic, push message, create consumer with handler.

const imqueue = require('in-memory-queue'); const topic = 'events'; imqueue.setQueueConfiguration(100, 2) .then(() => imqueue.createTopic(topic)) .then(() => imqueue.createMessage(topic, JSON.stringify({key: 'value'}))) .then(() => imqueue.createConsumer(topic, 1, msg => { console.log('Processing:', msg.getValue()); return Promise.resolve(); })) .catch(err => console.error(err));
Debug
Known issues
gotchaQueue size is fixed at configuration time; messages beyond capacity may throw or be dropped.
fix
Ensure setQueueConfiguration(size, maxRetry) size is large enough for your workload.
affects: >=1.0.0
gotchaAll examples use Bluebird promises; native Promise may work but official docs require Bluebird.
fix
Use Bluebird for compatibility or test with native Promise.
affects: >=1.0.0
gotchacreateMessage expects a stringified JSON, not an object. Passing an object silently fails.
fix
Always call JSON.stringify(payload) before passing to createMessage.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: imqueue.setQueueConfiguration is not a function
Package not installed or required incorrectly.
fix
Run `npm install in-memory-queue` then `const imqueue = require('in-memory-queue');`
UnhandledPromiseRejectionWarning: TypeError: msg.getValue is not a function
Handler received message object but method name may be different (e.g., getValue is incorrect).
fix
Log the msg object to inspect available methods; getValue is correct per docs.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
bluebirdoptionalUsed for Promise shimming in all examples; no actual dependency in package.json but strongly implied.
Agent activity
8 hits · last 30 days
node
8
Resources
in-memory-queue — npm install in-memory-queue · libregistry