Skip to content

Kaburaya optimize the number of goroutines by feedback control.

License

Notifications You must be signed in to change notification settings

monochromegane/kaburaya

Repository files navigation

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

About

Kaburaya optimize the number of goroutines by feedback control.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages