013: Go's concurrency to the rescue - podcast episode cover

013: Go's concurrency to the rescue

Nov 30, 202215 minEp. 13
--:--
--:--
Listen in podcast apps:
Metacast
Spotify
Youtube
RSS

Episode description

Go's worker queue pattern:

type WorderPool struct {
  queue chan int
}

func (wp *WorkerPool) start() {
  for i := 0; i < 500; i++ {
    go funcIO {
      for id := range wp.queue {
        doSomething(id)
      }
    }()
  }
}

func (wp *WorkerPool) add(id int) {
  wp.queue <- id
}


Best way to show support for the pod is by sharing it around and buying my course.

For the best experience, listen in Metacast app for iOS or Android
Open in Metacast
013: Go's concurrency to the rescue | go podcast() - Listen or read transcript on Metacast