Skip to content

wjbbig/goroutine-pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goroutine-pool

A simple implementation of goroutine pool

case:

pool := NewPool(3)

task := NewTask(func() error {
    fmt.Println("time now--->", time.Now().Format("2006-01-02 15:04:05"))
    return nil
})

go func() {
    for {
        time.Sleep(time.Second)
        pool.EntranceChan <- task
    }
}()

pool.run()

About

A simple implementation of goroutine pool

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages