gopool

package
v1.0.1-rel-02 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectIchubResultPool

func InjectIchubResultPool(s *IchubResultPool)

func InjectPageResultPool

func InjectPageResultPool(s *PageResultPool)

func LoadIchubResultPool

func LoadIchubResultPool() baseiface.ISingleton

func LoadPageResultPool

func LoadPageResultPool() baseiface.ISingleton

Types

type GeneralObjectPool

type GeneralObjectPool[T baseiface.IpoolObj] struct {
	CommonPool *pool.ObjectPool
}

func NewGeneralObjectPool

func NewGeneralObjectPool[T baseiface.IpoolObj]() *GeneralObjectPool[T]

NewGeneralObjectPool 使用传入的上下文初始化连接池

func (*GeneralObjectPool[T]) BorrowObject

func (self *GeneralObjectPool[T]) BorrowObject(ctx context.Context) (T, error)

BorrowObject 从连接池借用对象,增加了错误处理和重试逻辑

func (self *GeneralObjectPool[T]) Link() (T, error)

Link 初始化连接,通过指针类型初始化对象

func (*GeneralObjectPool[T]) ReturnObject

func (self *GeneralObjectPool[T]) ReturnObject(ctx context.Context, object T) error

ReturnObject 交还对象到连接池

type IchubResultPool

type IchubResultPool struct {
	basedto.BaseEntitySingle
	*GeneralObjectPool[*basedto.IchubResult]
}

func FindBeanIchubResultPool

func FindBeanIchubResultPool() *IchubResultPool

FindBeanIchubResultPool

func NewIchubResultPool

func NewIchubResultPool() *IchubResultPool

type PageResultPool

type PageResultPool struct {
	basedto.BaseEntitySingle
	*GeneralObjectPool[*page.PageResult]
}

func FindBeanPageResultPool

func FindBeanPageResultPool() *PageResultPool

FindBeanPageResultPool

func NewPageResultPool

func NewPageResultPool() *PageResultPool

Jump to

Keyboard shortcuts

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