https://github.com/bnkamalesh/routinepool
A minimalistic Go package to setup a worker pool which accepts functions of signature `fn()` [not maintained]
https://github.com/bnkamalesh/routinepool
go golang worker-pool worker-queue
Last synced: 6 months ago
JSON representation
A minimalistic Go package to setup a worker pool which accepts functions of signature `fn()` [not maintained]
- Host: GitHub
- URL: https://github.com/bnkamalesh/routinepool
- Owner: bnkamalesh
- License: mit
- Created: 2017-04-21T11:13:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-05T13:13:50.000Z (over 6 years ago)
- Last Synced: 2025-04-09T23:12:37.186Z (9 months ago)
- Topics: go, golang, worker-pool, worker-queue
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/bnkamalesh/routinepool)
[](https://gocover.run?tag=1.10&repo=github.com%2Fbnkamalesh%2Froutinepool)
[](https://goreportcard.com/report/github.com/bnkamalesh/routinepool)
[](https://codeclimate.com/github/bnkamalesh/routinepool/maintainability)
[](http://godoc.org/github.com/bnkamalesh/routinepool)
## 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()` - 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