# mesh-balance

> load balancing algorithms

Latest version **0.0.1** (published 2015-06-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install mesh-balance
pnpm add mesh-balance
yarn add mesh-balance
bun add mesh-balance
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-06-11 |
| First published | 2015-06-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 998 |
| Maintainers | architectd |
| Keywords | meshjs |

## Links

- npm: https://www.npmjs.com/package/mesh-balance
- Repository: https://github.com/crcn/mesh.js
- Issues: https://github.com/crcn/mesh.js/issues
- npm.io page: https://npm.io/package/mesh-balance

## Dependencies (7)

- [mesh](https://npm.io/package/mesh.md) ^1.0.x
- [sift](https://npm.io/package/sift.md) ^1.1.0
- [store](https://npm.io/package/store.md) ^1.3.17
- [xtend](https://npm.io/package/xtend.md) ^4.0.0
- [obj-stream](https://npm.io/package/obj-stream.md) 0.0.x
- [protoclass](https://npm.io/package/protoclass.md) 0.0.6
- [fast-event-emitter](https://npm.io/package/fast-event-emitter.md) 0.0.2

## Recent versions

- 0.0.1 (latest) — 2015-06-11

## README

load balancing algorithms for mesh


`npm install mesh-balance`

#### balance.rotate(workers)

Runs workers. Round-robin style.

```javascript
var workers = Array.apply(void 0, new Array(10)).map(function() {
  return mesh.wrap(function(operation, next) {
    next();
  });
});

var bus = mesh.rotate(workers);
```

#### balance.least(workers)

Runs the worker with the least number of running operations

#### balance.random(workers)

runs a random worker

---
_Source: https://npm.io/package/mesh-balance · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
