# consensus-manager

> consensus manager for a distributed topology

Latest version **1.0.0** (published 2014-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install consensus-manager
pnpm add consensus-manager
yarn add consensus-manager
bun add consensus-manager
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-10-09 |
| First published | 2014-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | gpestana |
| Maintainers | gpestana |
| Keywords | consensus, distributed systems |

## Links

- npm: https://www.npmjs.com/package/consensus-manager
- Repository: https://github.com/gpestana/consensus-manager
- Issues: https://github.com/gpestana/consensus-manager/issues
- npm.io page: https://npm.io/package/consensus-manager

## Recent versions

- 1.0.0 (latest) — 2014-10-09

## README

###consensus-manager

####consensus wrapper for a distributed topology

The consensus manager listens and stores responses from remote peers until the
consensus is reached. The consensus is reached depending on the strategy 
implemented.   

The *consensus manager* controls:
* time it takes to reach consensus
* accepts and stores responses from peers
* notices upper layer when consensus is reached and its output (if any)  

The *strategy* defines:  
* when consensus is reached  


####installation
> sudo npm install consensus-manager


####example
```javascript

Strategy         = require('..')
ConsensusManager  = require('ConsensusManager') 

var strategy = new Startegy(strategy_opts)  
var consensus = new ConsensusManager(strategy)  


consensus.on('listening', function(){
  //event fired when consensus manager is initialized
})

consensus.on('consensus', function(result, time_diff){
  //event fired when consensus is reached
})

consensus.on('noListening', function(){
  //event fired when a peer's response arrives but consensus has been reached
})



//init consensus manager
consensus.init// ... stuff happen, user sent a response

//...
 
//peer answers. consensus manager processes its response
consensus.process(response)

```

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