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.
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.
Click to show internal directories.
Click to hide internal directories.