Skip to content

Agraphie/NaiveWorkerPool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NaiveWorkerPool

Go Report Card

Go package for using a simple and dynamically growing worker pool to submit functions to.

initialWorkerCount := uint64(4)
maxWorker := uint(64)
pool := Create(initialWorkerCount, maxWorker)

pool.Submit(func() {
  // Any work you want to be done. Pool will grow dynamically when too much work is queued up.
})

// Shut down the pool, but wait for all work to be done
pool.Dispose()

A pool can grow until it reaches the specified max worker limit. The pool will stay on that level until all work is done. It will then decrease again until it reaches the initial size. The growing will (naively) starting now when more than 10 functions are queued up.

See GoDoc for more details.

About

A simple worker pool for submitting work to

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages