Skip to content

00arthur00/gate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gate

concurrent control Gate.

// TODO: better with a http server example
func ExampleGate() {
	g := NewGate(10)
	work := func() {
		//do something here
	}
	for {
		go func() {
			defer g.Leave()
			g.Enter()
			work()
		}()
	}
	select {}
}

About

simple concurrent request control

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages