package
Version:
v0.5.0
Opens a new window with list of versions in this module.
Published: Oct 27, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package gpool provides a generic sync.Pool.
Pool is a generic sync.Pool.
func New[T any](newFunc func() T) Pool[T]
New returns an initialized generic sync.Pool.
func (p *Pool[T]) Get() (val T)
Get retrieves a resource from the pool.
Returns the zero value of T if no resource is available and no New func is specified.
func (p *Pool[T]) Put(val T)
Put puts the resource into the pool.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.