Sha256: 624bd0acbf93e4f26603d55898518292d21fa5692485337e24e49d6a50eceff9

Contents?: true

Size: 914 Bytes

Versions: 2

Compression:

Stored size: 914 Bytes

Contents

#!/usr/bin/env ruby
Thread.abort_on_exception = true

require_relative '../lib/buschtelefon'

include Buschtelefon

# A
# ↕
# B ↔ D ↔ E
# ↓   ↑
# C → F

tattlers = {
  A: Tattler.new,
  B: Tattler.new,
  C: Tattler.new,
  D: Tattler.new,
  E: Tattler.new,
  F: Tattler.new
}

tattlers[:A].connect(tattlers[:B])
tattlers[:B].connect(tattlers[:A])

tattlers[:B].connect(tattlers[:C])
tattlers[:C].connect(tattlers[:F])
tattlers[:F].connect(tattlers[:D])

tattlers[:B].connect(tattlers[:D])
tattlers[:D].connect(tattlers[:B])

tattlers[:D].connect(tattlers[:E])
tattlers[:E].connect(tattlers[:D])

puts 'Feeding locals'
tattlers[:A].feed(Gossip.new('Tezos'))

josua = NetTattler.new
simon = NetTattler.new
remote_simon = RemoteTattler.new(host: 'localhost', port: simon.port)

josua.connect(remote_simon)

Thread.new { josua.listen }
Thread.new { simon.listen }

remote_simon.feed(Gossip.new('Antshare'))

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
buschtelefon-0.3.0 bin/run
buschtelefon-0.2.0 bin/run