Challenge 3b: Multi-Node Broadcast

desccode

Built on our single-node code, now we're actually spreading messages across multiple nodes! Kept it super simple but effective - just tell everyone about new messages.

What it Does

Instead of getting fancy with topology or complicated gossip protocols, went with the most straightforward solution:

How it Works

Message Propagation

Each new message gets blasted out to all other nodes (except the sender). Using goroutines to send messages concurrently keeps things snappy.

Message Storage

Why This Works

  1. Full Connectivity: Every node knows about every other node

  2. Direct Communication: No need to route through intermediaries

  3. Fast Propagation: New messages spread in one hop

  4. Duplicate Prevention: Map-based deduplication keeps us efficient

Trade-offs

Pros:

Cons:

But for our needs here ig, simple is better than complex. This does the job reliably and the code is clear. We'll optimize if we need to in 3d and 3e!