
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
Lean and customizable in-memory message queue. Main motivation is to provide grouping based message / job queue functionality.
In future - a plan is to provide different persistence options.

var leanmq = require('lean-mq');
var q = leanmq.Queue('test');
// function to handle tasks
q.handle(function(obj){
console.log('handle - obj = ', obj );
return Promise.resolve(true);
});
// add tasks
q.add( { key: "1", data:"abc" } );
//
// Prints: handle - obj = { key: "1", data:"abc" }
//
var leanmq = require('lean-mq');
var opts = {window:5000};
// window -> time-window (ms) to use for groupping, default is 5 seconds
var c = leanmq.Chain('test', opts);
// function to attach one or more workers
q.attach(function(obj){
console.log('worker 1 - obj = ', obj );
return Promise.resolve(true);
});
q.attach(function(obj){
console.log('worker 2 - obj = ', obj );
return Promise.resolve(true);
});
// add tasks
q.add( "a", { id: 1 } );
q.add( "b", { id: 2 } );
q.add( "a", { id: 3 } );
q.add( "b", { id: 4 } );
//
// Prints:
// worker 1 - obj = { key: "a", data:[{ id: 1 }, { id: 3 }] }
// worker 2 - obj = { key: "b", data:[{ id: 2 }, { id: 4 }] }
//
var leanmq = require('lean-mq');
var opts = {window: 5000, storage: 'redis', connection: {host: "localhost" }};
var c = leanmq.Chain('test', opts);
// everything else is the same
// for all connection options, see:
// https://github.com/NodeRedis/node-redis#options-object-properties
/*
{
host: '127.0.0.1',
port: 6379,
db: 0,
options: {},
}
*/
Constructor for the simple queue object, opts are optional
// DEFAULT_OPTIONS
{
storage: 'memory', // memory, redis
connection: null,
attempts: 3,
retry_delay: 1000
}
Sets a handler function. Function should accept an object as argument and return promise.resolve / reject
Adds a task to the simple queue, that is then processed by function
Listens to event emitter - new
Constructor for the chain (groupped queue) object, opts are optional
// DEFAULT_OPTIONS
{
window: 5000 // 5 seconds
}
Sets a worker function. Function should accept an object as argument and return promise.resolve / reject Round-robin is used to balance the load.
Adds a task to the chain, that is then processed by one of functions after time. Key is used for groupping
Listens to event emitter - error
// DEFAULT_OPTIONS
{
port: 2525 // to accept Socket connection
}
// DEFAULT_OPTIONS
{
name: 'none',
url: 'localhost:2525' // broker address and port
}
| name | add | feature 1 | feature 2 | feature 3 |
|---|---|---|---|---|
| lean-mq | 0 ms | + | + | - |
| some other | 0 ms | + | - | + |
FAQs
Lean and customizable in-memory message queue
We found that lean-mq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.