Last active
May 18, 2016 15:39
-
-
Save nicola/b1cc099fb4e8a26c003a6aa9b24ccf0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v1 | |
const GossipSwarm = require('gossip-swarm') | |
const CyclonProtocol = require('gossip-cyclon') | |
const swarm = GossipSwarm({ | |
shuffle: CyclonProtocol | |
}) | |
swarm.shuffle() | |
var sending = swarm.createWriteStream() | |
var receiving = swarm.createReadStream() | |
receiving.on('data', (data) => { | |
console.log(data) | |
}) | |
sending.write({message: 'hello every one'}) | |
// v2 | |
const GossipSwarm = require('gossip-swarm') | |
const Cyclon = require('gossip-cyclon') | |
const swarm = Cyclon() | |
swarm.shuffle() | |
var sending = swarm.createWriteStream() | |
var receiving = swarm.createReadStream() | |
receiving.on('data', (data) => { | |
console.log(data) | |
}) | |
sending.write({message: 'hello every one'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you write a bit about what the single purpose of each module is (gossip-swarm and gossip-cyclon)? I think having a concrete understanding of each module's inputs and outputs will help the process of fleshing out the API.