Kaburaya optimize the number of goroutines by feedback control.
Switch branches/tags
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.
.travis.yml
LICENSE
README.md
controller.go
controller_test.go
elastic_semaphore.go
elastic_semaphore_test.go
queue.go
queue_test.go
recorder.go
reporter.go
semaphore.go

README.md

Kaburaya Build Status

WIP.

Kaburaya optimize the number of goroutines by feedback control. It provides elastic semaphore.

Usage

sem := kaburaya.NewSem(100*time.Millisecond, 0.1)
var wg sync.WaitGroup
for // Something condition {
	wg.Add(1)
	sem.Wait()
	go func() {
		defer sem.Signal()
		defer wg.Done()
		// Something job
	}()
}
wg.Wait()
sem.Stop()

License

MIT

Author

monochromegane