package
Version:
v0.21.10
Opens a new window with list of versions in this module.
Published: Jan 19, 2023
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 4
Opens a new window with list of known importers.
Documentation
¶
func New[T any](NewF func() *T, ValidF func(*T) (inUse bool), ReuseF func(*T) *T, PoolF func(*T) *T, maxsize int) *Buf[T]
创建池
NewF: func() *T 新值
ValidF func(*T) (inUse bool) 是否可重用(是否还在使用)
ReuseF func(*T) *T 重用前处理
PoolF func(*T) *T 入池前处理
maxsize int 池最大数量
func (t *Buf[T]) Get() *T
func (t *Buf[T]) Put(item ...*T)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.