Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Chat-Wane/BoundedBroadcastDefinition

You know what they put on French fries in Holland instead of ketchup?
https://github.com/Chat-Wane/BoundedBroadcastDefinition

Last synced: about 1 month ago
JSON representation

You know what they put on French fries in Holland instead of ketchup?

Awesome Lists containing this project

README

        

# BoundedBroadcastDefinition

Broadcasting component on top of a communication overlay. It uses a bounded
growing cache to collect the unique identifier of each message. Therefore, if
the cache size is large enough, the messages are broadcast only once per peer in
the network.

## Installation

```
$ npm install bounded-broadcast-definition
```
or
```
$ bower install bounded-broadcast-definition
```

## Usage

The module has been [browserified](http://browserify.org) and
[uglified](https://github.com/mishoo/UglifyJS). To include it within your
browser, put the following line in your html:
```html


```

In any case:
```javascript
var BoundedBroadcast = require('bounded-broadcast-definition');
var RandomPeerSampling = require('random-peer-sampling-example');

// #1 initialize the protocols
rps = new RandomPeerSampling(args1);
broadcast = new BoundedBroadcast(rps, size);

// #2 define the receive event of broadcast
broadcast.on('receive', function(receivedBroadcastMessage){
console.log('I received the message: ' + receiveBroadcastMessage);
});

// #3 send a message to the whole network
broadcast.send(toBroadcastMessage);
```