recycle

package
v0.0.0-...-b3611eb Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPool

func RegisterPool[BT any, T any]()

func RegisterPoolWithCleaner

func RegisterPoolWithCleaner[BT any, T any](cleanFunc func(bt BT))

RegisterPoolWithCleaner registers a pool To allocates instance of T T is the target struct To be used. *T should implement the BT interface. if T needs To do close or clean operations, do it in cleanFunc, otherwise nil

Types

type Recycler

type Recycler[BT any] interface {
	HandleAndRecycle(handleBtFunc func(bt BT) error) error
	Assign(h func(bt BT))
}

func FindPool

func FindPool[BT any](bt BT) Recycler[BT]

func Get

func Get[BT any, T any]() Recycler[BT]

Jump to

Keyboard shortcuts

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