Help us shape the future of Go! Take the 2026 Go Developer Survey

netpool

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt[T any] struct {
	Name       string
	TargetSize int
	New        func(context.Context) (T, error)
	Release    func(T) error
}

type Pool

type Pool[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](opt Opt[T]) *Pool[T]

func (*Pool[T]) Close

func (p *Pool[T]) Close() error

func (*Pool[T]) Discard

func (p *Pool[T]) Discard(v T) error

func (*Pool[T]) Fill

func (p *Pool[T]) Fill(ctx context.Context)

func (*Pool[T]) Get

func (p *Pool[T]) Get(ctx context.Context) (T, error)

func (*Pool[T]) Put

func (p *Pool[T]) Put(v T)

Jump to

Keyboard shortcuts

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