Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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?
- Host: GitHub
- URL: https://github.com/Chat-Wane/BoundedBroadcastDefinition
- Owner: Chat-Wane
- License: mit
- Created: 2015-01-20T09:17:42.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-09T11:08:39.000Z (over 9 years ago)
- Last Synced: 2024-10-11T09:49:39.306Z (2 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-peer-to-peer - BoundedBroadcastDefinition
- awesome-peer-to-peer - BoundedBroadcastDefinition
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);
```