Sobes.tech
Junior — Senior

Constructing a worker pool

livecode

Task condition

It is necessary to build a mechanism that:

  • Launches no more than three workers simultaneously;
  • Makes HTTP GET requests to each address from the provided list;
  • Limits the number of parallel requests to avoid overloading the system.
package main 
        
import {
    "log"
        }
        
        
func main() {
    pool :=makePool(3)
    for url := range generateUrls(5){
        log.Printf("=> Starting, %s", url)
        pool.Dowork(url)        
    }
}