Slide 47
Slide 47 text
A Tour of Go Concurrency
func fibonacci(c, quit chan int) {
x, y := 0, 1
for {
select {
case c <- x:
x, y = y, x+y
case <-quit:
fmt.Println("quit")
return
}
}
}
Go
https://tour.golang.org/concurrency/5 47
A CancellationToken
A boilerplate