Skip to content

SlIdE42/goworkers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goworkers

GitHub Workflow Status codecov golangci GoDoc Go Report Card

goworkers is a simple but effecient dynamic workers pool

Types

type Pool

type Pool struct { ... }

Pool is a workers pool

Examples

ch := make(chan int)

pool := Init(func() {
    i := <-ch
    fmt.Println(i * i)
})

pool.Add(1)
ch <- 2
ch <- 3
wait := pool.Stop()
ch <- 4
<-wait

Output:

4
9
16

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages