Skip to content
A minimalistic Go package to setup a worker pool which accepts functions of signature `fn()`
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
pool.go
pool_test.go

README.md

gocover.run

Routinepool

Routinepool is a simple Go library to start a worker pool. The example provided in the test illustrates everything what this worker pool can do. e.g. See number of active jobs, pending jobs, stop worker pool etc.

  1. Start worker pool
  2. Push tasks/work to the pool
  3. See active number of tasks
  4. See pending tasks

Methods available

  1. New() - returns a new Pool pointer with all the configurations set, ready to be used
  2. p.Start() - starts the workerpool and waits for tasks to be pushed
  3. p.Push(<task>) - pushes a work/task to the queue
  4. p.Active() - returns the number of tasks which are actively running
  5. p.Pending() - returns the number of tasks which are pending in the queue
  6. p.Stop() - gracefully shutsdown the workerpool, i.e. waits for the queue to be empty and shutdown
You can’t perform that action at this time.