Hi Folks, Love to watch more and more code reviews like this ( https://www.youtube.com/watch?v=eIWFnNz8mF4 ) from Francesc Campoy. while watching the code review i got a very silly doubt in the following code snippet.
Assume I have Ten tasks & set concurrency value to be 10. would that be guaranteed that we have 10 goroutines processing 10 Tasks? I don't see that happening .. thoughts. https://github.com/philipithomas/iterscraper/blob/master/main.go#L60 for i := 0; i < *concurrency; i++ { log.Printf(" loop %d ", i) go func() { defer wg.Done() for t := range tasks { log.Printf("concurrency: %d task: %d ", i, t.id) site, err := fetch(t.url, t.id, columns) if err != nil { log.Printf("could not parse website %v ", err) continue } results <- site } }() and how the same program behaves if we have 2 Concurrency value with 20 tasks and vice versa? Thanks SJ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.