middleware

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcurrencyLimiter

func ConcurrencyLimiter(cfg ConcurrencyConfig) echo.MiddlewareFunc

ConcurrencyLimiter returns an Echo middleware that limits concurrent handler executions. Excess requests are queued up to MaxQueueSize. Requests that cannot enter the queue receive 503 (QUEUE_FULL). Requests that wait longer than QueueTimeout receive 503 (QUEUE_TIMEOUT).

Types

type ConcurrencyConfig

type ConcurrencyConfig struct {
	MaxConcurrency int
	MaxQueueSize   int
	QueueTimeout   time.Duration
}

ConcurrencyConfig holds parameters for the concurrency limiter middleware.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL