GoSlaves is a simple golang's library which can handle wide list of tasks asynchroniously
go get github.com/themester/GoSlaves
sp := slaves.MakePool(10)
if err := sp.Open(func(obj interface{}) interface{} {
fmt.Println(obj.(string))
return nil
}, nil); err != nil {
panic(err)
}
defer sp.Close()
files, err := ioutil.ReadDir(os.TempDir())
if err == nil {
fmt.Println("Files in temp directory:")
for i := range files {
sp.SendWork(files[i].Name())
}
}