Log in

goodpods headphones icon

To access all our features

Open the Goodpods app
Close icon
go podcast() - 013: Go's concurrency to the rescue

013: Go's concurrency to the rescue

11/30/22 • 14 min

go podcast()

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.

plus icon
bookmark

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.

Previous Episode

undefined - 012: Concurrency isn't Go main selling point

012: Concurrency isn't Go main selling point

Let's talk about Go's concurrency. It's a powerful tool to have at your disposal but a hard one to master and use correctly.

If you want to support the pod the best way is to purchase my course (thanks).

Next Episode

undefined - 014: We should contribute more to open source

014: We should contribute more to open source

This is the last episode of 2022. Those are my thoughts about how I think we should try to help more as user of open source project and librairies.

This episode content was inspired by the Gorilla Web Tool Kit archiving their Go projects.

On that note, I'll be back with more Go content on January, and will try to keep my 1 episode per two weeks plan for 2023.

Thank you!

Episode Comments

Generate a badge

Get a badge for your website that links back to this episode

Select type & size
Open dropdown icon
share badge image

<a href="https://goodpods.com/podcasts/go-podcast-481108/013-gos-concurrency-to-the-rescue-64380014"> <img src="https://storage.googleapis.com/goodpods-images-bucket/badges/generic-badge-1.svg" alt="listen to 013: go's concurrency to the rescue on goodpods" style="width: 225px" /> </a>

Copy