Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

tag: 0.0.1

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 test
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 README.markdown
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.markdown

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: 1, auth: 2 },
  b: { web: 1 },
  a: { web: 1, logger: 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

Something went wrong with that request. Please try again.