pool

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

func New

func New[T any](new func(key string) Runner[T]) *Pool[T]

func (*Pool[T]) Close

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

func (*Pool[T]) Get

func (p *Pool[T]) Get(key string) Runner[T]

func (*Pool[T]) Keys

func (p *Pool[T]) Keys() []string

func (*Pool[T]) Remove

func (p *Pool[T]) Remove(key string)

type Runner

type Runner[T any] interface {
	Run()
	Push(t T)
	LastWrite() time.Time
	Close() error
}

Jump to

Keyboard shortcuts

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