Skip to content

Instantly share code, notes, and snippets.

@nicola
Last active May 18, 2016 15:39
Show Gist options
  • Save nicola/b1cc099fb4e8a26c003a6aa9b24ccf0b to your computer and use it in GitHub Desktop.
Save nicola/b1cc099fb4e8a26c003a6aa9b24ccf0b to your computer and use it in GitHub Desktop.
// 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'})
@hackergrrl
Copy link

hackergrrl commented May 18, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment