Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrencyLimiter ¶
type ConcurrencyLimiter struct {
// contains filtered or unexported fields
}
func NewConcurrencyLimiter ¶
func NewConcurrencyLimiter(handler http.Handler, concurrencyLimit int) *ConcurrencyLimiter
NewConcurrencyLimiter creates NewConcurrencyLimiter with a Handler() function that returns a handler which limits the active number of active, concurrent requests.
If the concurrency limit is less than, or equal to 0, then it will just return the handler passed to it.
The Met() function will return true if the concurrency limit is exceeded within the handler at the time of the call.
func (*ConcurrencyLimiter) Handler ¶ added in v1.1.0
func (cl *ConcurrencyLimiter) Handler() http.Handler
func (*ConcurrencyLimiter) Met ¶ added in v1.1.0
func (cl *ConcurrencyLimiter) Met() bool
func (*ConcurrencyLimiter) ServeHTTP ¶
func (cl *ConcurrencyLimiter) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.