pool

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlexiblePool

type FlexiblePool struct {
	New func(int) interface{}
	// contains filtered or unexported fields
}

FlexiblePool Flexible Pool

func NewFlexiblePool

func NewFlexiblePool(sizeControler []int, Newer func(int) interface{}) *FlexiblePool

NewFlexiblePool func

func (*FlexiblePool) Get

func (fp *FlexiblePool) Get(size int) (interface{}, error)

Get func

func (*FlexiblePool) MaxSize

func (fp *FlexiblePool) MaxSize() int

MaxSize max pool item size

func (*FlexiblePool) Put

func (fp *FlexiblePool) Put(data interface{}, size int) error

Put func

type MapPool

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

MapPool map pool

func (*MapPool) Delete

func (p *MapPool) Delete(k interface{})

Delete func

func (*MapPool) GetPool

func (p *MapPool) GetPool(k interface{}) *SubPool

GetPool func

func (*MapPool) Init

func (p *MapPool) Init(groupSum int)

Init func

func (*MapPool) LenTotal

func (p *MapPool) LenTotal() int

LenTotal func

func (*MapPool) Load

func (p *MapPool) Load(k interface{}) (interface{}, bool)

Load func

func (*MapPool) LoadOrStore

func (p *MapPool) LoadOrStore(k, v interface{}) (interface{}, bool)

LoadOrStore func

func (*MapPool) Range

func (p *MapPool) Range(cb func(k, v interface{}) bool)

Range func

func (*MapPool) Store

func (p *MapPool) Store(k, v interface{})

Store func

type SubPool

type SubPool struct {
	sync.Map
}

SubPool sub pool

func (*SubPool) Len

func (p *SubPool) Len() int

Len func

Jump to

Keyboard shortcuts

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