rp

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: BSD-3-Clause Imports: 0 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] chan *T

func NewPool

func NewPool[K any](max uint64) Pool[K]

func (Pool[T]) Acquire

func (p Pool[T]) Acquire() (_p *T)

func (Pool[T]) Release

func (p Pool[T]) Release(item *T)

type PoolOption

type PoolOption[T any] func(*Pooler[T])

func WithSize

func WithSize[T any](size uint64) PoolOption[T]

type Pooler

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

func NewPooler

func NewPooler[T any](options ...PoolOption[T]) *Pooler[T]

func (*Pooler[T]) Acquire

func (p *Pooler[T]) Acquire() *T

func (*Pooler[T]) Release

func (p *Pooler[T]) Release(item *T)

Jump to

Keyboard shortcuts

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