syncPool

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncPool

type SyncPool struct {
	// contains filtered or unexported fields
}

func NewSyncPool

func NewSyncPool(newFunc func() interface{}, init func(interface{})) *SyncPool

NewSyncPool 创建对象池 newFunc:创建对象的方法 init: 对象被创建后,返回之前,调用该方法初始化对象

func (*SyncPool) Get

func (that *SyncPool) Get() interface{}

Get 获取对象

func (*SyncPool) Put

func (that *SyncPool) Put(value interface{})

Put 把对象放回对象池

Jump to

Keyboard shortcuts

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