Chapter 14

  1. What is a generator? What are its responsibilities?
    A generator is a tool that returns a series of values—it returns the next value in the series each time it is called. It's responsible for generating values in the sequence on demand. In Go, this can be done by using a channel to receive the values that are sent through by a goroutine that creates them.
  2. How would you describe a pipeline?
    A pipeline is a type of application flow that splits the execution into different stages. These stages communicate with one another by using a certain means of communication, such as networks, or runtime internals, such as channels.
  3. What type of stage gets a channel and returns one?
    An intermediate stage will receive from a receive-only channel and return another receive-only channel.
  4. What is the difference between fan-in and fan-out?
    Fan-in is also known as demultiplexing, and entails gathering messages from different sources into one. Fan-out, or multiplexing, is the opposite—it entails splitting a single source of a message to more receivers.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.102.6