Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Poolobj ¶
type Poolobj[T any] struct { // contains filtered or unexported fields }
func NewPool ¶
func NewPool[T any](maxsize int, initcreate int, constructor func(*T), destructor func(*T)) Poolobj[T]
NewPool creates a new Poolobj initialized with the given parameters.
maxsize specifies the maximum number of objects that can be kept in the pool.
initcreate specifies the initial number of objects to create in the pool on startup.
constructor, if non-nil, is called whenever a new object needs to be created.
destructor, if non-nil, is called whenever an object is removed from the pool.
Click to show internal directories.
Click to hide internal directories.