Skip to content

ChinaHDJ1/executor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Usage

##FixedExecutor

exec := executor.NewFixedExecutor(5) // create 5 fixed worker
future := exec.Execute(func() interface{} {
  time.Sleep(1 * time.Second)
  return "this is my value"
})


if <-future.Done(); future.Error() != nil {
  fmt.Println(future.Value().(string)) //this is my value
}else {
  //handle error
}

exec.Release()

About

goroutine pool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages