2020-03-29 10:46:48 -03:00
2020-03-28 18:25:36 -03:00
2020-03-28 18:25:36 -03:00
2020-03-28 18:25:36 -03:00
2020-03-29 10:21:09 -03:00
2020-03-28 18:25:36 -03:00
2020-03-21 11:56:34 -03:00
2020-03-28 18:25:36 -03:00
2020-03-28 18:25:36 -03:00
2020-03-28 18:25:36 -03:00
2020-03-29 10:46:48 -03:00

pond

pond: Minimalistic and High-performance goroutine worker pool written in Go

Features:

  • Managing and recycling a massive number of goroutines automatically
  • Purging overdue goroutines periodically
  • Minimalistic API for submitting tasks, getting the number of running goroutines, stopping the pool and more.
  • Zero dependencies
  • Handle task panics gracefully
  • Efficient memory usage
  • Blocking and Nonblocking modes supported

How to install

go get -u github.com/alitto/pond

How to use

package main

import (
	"fmt"

	"github.com/alitto/pond"
)

func main() {

	// Create a pool with 100 workers
	pool := pond.New(100, 1000)

	// Submit 1000 tasks
	for i := 0; i < 1000; i++ {
		n := i
		pool.Submit(func() {
			fmt.Printf("Running task #%d\n", n)
		})
	}

	// Stop the pool and wait for all submitted tasks to complete
	pool.StopAndWait()
}
S
Description
🔘 Minimalistic and High-performance goroutine worker pool written in Go
Readme 274 KiB
Languages
Go 99.7%
Makefile 0.3%