github.com/cube-group/gopool

go routines pool


Install
go get github.com/cube-group/gopool

Documentation

gopool

go routines pool

Demo

func TestBad(t *testing.T) {
	GoPoolMaxNum = 2
	GoPoolDebug = true

	for i := 0; i < 100; i++ {
		Go(func() {
			time.Sleep(time.Millisecond*2)
		})
		time.Sleep(time.Millisecond)
	}
	time.Sleep(10*time.Second)
}