 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler implements the http.Handler interface.
func New ¶
New returns an http.Handler that uses limiter to control h invocation. If limiter prohibits starting a new handler, OverloadHandler will be invoked.
type Limiter ¶
type Limiter interface {
	// Start decides whether a new job can be started. The decision may be
	// returned after a delay if the limiter wants to throttle jobs.
	Start(context.Context) bool
	// Done must be called when a job is finished.
	Done()
}
    A Limiter controls starting of jobs.
func NewLimiter ¶
NewLimiter return a limiter that allows no more than maxRunning jobs at the same time. It can enqueue up to maxInQueue jobs awaiting to be run, and a job may wait in the queue no more than maxWaitInQueue.
       Source Files
      ¶
      Source Files
      ¶
    
- limiter.go
- maxconnections.go
 Click to show internal directories. 
   Click to hide internal directories.