pool

package
v2.3.1-beta Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectPool

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

ObjectPool is a generic analogue of sync.Pool, except it does not provide thread-safety. Concurrent access may lead to UB

func NewObjectPool

func NewObjectPool[T any](queueSize int) ObjectPool[T]

func (*ObjectPool[T]) Acquire

func (o *ObjectPool[T]) Acquire() (obj T)

func (*ObjectPool[T]) Release

func (o *ObjectPool[T]) Release(obj T)

Jump to

Keyboard shortcuts

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