Grokking Concurrency in Go
Vote

0% completed

​

Tee and Bridge Channels

A tee function takes one input channel and returns two output channels, and it sends every input value to both outputs. A tee written as in this lesson makes three promises:

  1. Each output receives every value.
  2. Each output receives the values in the original order.
  3. Both outputs are closed when the input is closed or the context is done.

It does not promise that the two readers are independent. A tee without a buffer passes the next value on only after both readers have taken the current one, so both readers run at the speed of the slower one. It also makes no deep copy

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content