We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Subscriber

Publishers publish, and subscribers subscribe. You might also hear a few alternative terms:

  • Publisher = Producer = Sender
  • Subscriber = Consumer = Receiver

Assignment

Let's further separate the "subscribing" logic from the "distribution" logic.

Complete the doBattles method on the user type. It takes a channel that receives move structs. It should return a slice of pieces, []piece, that represents pieces in battle.

    • List the user's pieces in battle in the order of the messages received
    • Don't worry about deduplication