sync_pool

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

sync_pool is a generic sync.Pool wrapper

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncPool

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

func New

func New[T any](init func() T, reset func(T)) SyncPool[T]

New creates a new Pool[T].

func (*SyncPool[T]) Get

func (p *SyncPool[T]) Get() T

Get returns a new T from the pool.

func (*SyncPool[T]) New

func (p *SyncPool[T]) New() T

New creates a new object of type T.

func (*SyncPool[T]) Put

func (p *SyncPool[T]) Put(val T)

Put returns a T to the pool.

Jump to

Keyboard shortcuts

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