New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

marx

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marx

allocate worker roles among a collective of workers according to their abilities

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

marx

Allocate worker roles among a collective of workers according to their abilities.

build status

example

var marx = require('marx');

var work = { web : 3, auth : 2, logger : 1 };
var workers = { a : 2, b : 1, c : 5 };

var shares = marx(workers, work);
console.dir(shares);

output:

{ c: { web: 2, auth: 1 },
  b: { auth: 1 },
  a: { logger: 1, web: 1 } }

methods

var marx = require('marx')

marx(workers, work)

Take an object mapping worker names to role capacity and an object mapping work names to a number of instances.

Return an object mapping worker names to objects mapping how many of each type of work each worker should perform.

If the workers don't have enough capacity to do the work, the extra work will appear in an '_overflow' key in the result.

install

With npm do:

npm install marx

license

MIT

Keywords

work

FAQs

Package last updated on 21 Apr 2012

Did you know?

Socket

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.

Install

Related posts