netutil

package
v1.54.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SharedLimitListener

func SharedLimitListener(listener net.Listener, limiter *Limiter) net.Listener

SharedLimitListener returns a Listener that accepts simultaneous connections from the provided Listener only if a shared availability pool permits it. Based on https://godoc.org/golang.org/x/net/netutil

Types

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

Limiter is used to provide a shared pool of connection slots. Use NewLimiter to create an instance

func NewLimiterWithMetrics added in v1.37.0

func NewLimiterWithMetrics(n int, maxConnsCount, concurrentConnsCount, waitingConnsCount prometheus.Gauge) *Limiter

NewLimiterWithMetrics creates a Limiter with metrics

Jump to

Keyboard shortcuts

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