Documentation ¶
Overview ¶
Package limiter schedules job execution while maintaining an upper limit on concurrency
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter schedules go routines for execution, while ensuring that no more than a pre-set limit run at any time.
func (*Limiter) Go ¶
func (l *Limiter) Go(f func())
Go executes the function f when the goroutine limit allows it. Go wraps the execution of f around an Open/Close pair.
func (*Limiter) Open ¶
func (l *Limiter) Open()
Open blocks until there are fewer than limit unclosed sessions. A session begins when Open returns.
Click to show internal directories.
Click to hide internal directories.