sync

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 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 IPoolData

type IPoolData interface {
	Reset()
	IsRef() bool
	Ref()
	UnRef()
}

type Pool

type Pool struct {
	C chan interface{} //最大缓存的数量
	// contains filtered or unexported fields
}

func NewPool

func NewPool(C chan interface{}, New func() interface{}) *Pool

func (*Pool) Get

func (pool *Pool) Get() interface{}

func (*Pool) Put

func (pool *Pool) Put(data interface{})

type PoolEx

type PoolEx struct {
	C chan IPoolData //最大缓存的数量
	// contains filtered or unexported fields
}

func NewPoolEx

func NewPoolEx(C chan IPoolData, New func() IPoolData) *PoolEx

func (*PoolEx) Get

func (pool *PoolEx) Get() IPoolData

func (*PoolEx) Put

func (pool *PoolEx) Put(data IPoolData)

Jump to

Keyboard shortcuts

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