O'Reilly logo

Distributed Computing with Go by V.N. Nikhil Anurag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Messages and events

So far we have been using the term data to refer to the values that are being sent and received from a channel. While this might be easy to understand so far, Go uses two specific terms to describe the type of data that is being communicated over the channels. They are called messages and events. In terms of code they are identical, but the terms are used to help us understand the type of data that is being sent. In a nutshell:

  • Messages are generally values we want the goroutine to process and act on them if required.
  • Events are used to signify that a certain event has occurred. The actual value received might not be as important as the act of receiving a value. Note that though we use the term event, they are still a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required