Skip to content

storyfeet/workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workers is a simple project to get a fixed number of workers running a specific set of func() , no return for safety.

You can see some accompanying insight in this YouTube video.

-- note a small change in the code from the video, thanks to Devarsh Shah, Who pointed out, the workers can range on res.Main instead of checking inside the for loop.

so

for {
    f := <-res.Main
    if f != nil {
        procDone <- true
        return
    }
    f()
}

becomes

for f := range res.Main {
    f()
}
procDone <- true

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages