Skip to content

A worker pool library with up- and down-scaling support

License

Notifications You must be signed in to change notification settings

Zytekaron/go-workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-workers

go get github.com/Zytekaron/go-workers

Support: Contact Me

Method Overview

Creation

NewPool(size int, run RunFunc) Create a new WorkerPool with an initial worker count
NewBufferedPool(size int, bufSize int, run RunFunc) Create a new WorkerPool with an initial worker count and job buffer size

RunFunc = func(interface{})

Basic usage

Pool#Size() Get the total number of workers in this WorkerPool
Pool#Busy() Get the number of busy workers in this WorkerPool
Pool#Run(data interface{}) Add a job to this WorkerPool

Scaling

Pool#ScaleUp(newSize int) Scale the WorkerPool up to a new specified size
Pool#ScaleUp(newSize int) Scale the WorkerPool down to a new specified size

Examples

Example usage can be found here

License

go-workers is licensed under the MIT License

About

A worker pool library with up- and down-scaling support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages