pool

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPoolTernimated = errors.New("pool is ternimated")
	ErrTimeout        = errors.New("timeout")
)

Functions

This section is empty.

Types

type Handler added in v1.0.1

type Handler[T any] interface {
	Handle(ctx context.Context, value T)
}

type HandlerFunc added in v1.0.1

type HandlerFunc[T any] func(ctx context.Context, value T)

func (HandlerFunc[T]) Handle added in v1.0.1

func (fn HandlerFunc[T]) Handle(ctx context.Context, value T)

type Pool

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

func New added in v1.0.1

func New[T any](size int, consumers int, handler Handler[T]) *Pool[T]

func (*Pool[T]) Shutdown

func (p *Pool[T]) Shutdown()

func (*Pool[T]) Submit

func (p *Pool[T]) Submit(ctx context.Context, timeout time.Duration, value T) error

Jump to

Keyboard shortcuts

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