gopool

package
v1.4.125 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectIchubResultPool

func InjectIchubResultPool(s *IchubResultPool)

func LoadIchubResultPool

func LoadIchubResultPool() 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)

ReturnObject 交还对象到连接池

type IchubResultPool

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

func FindBeanIchubResultPool

func FindBeanIchubResultPool() *IchubResultPool

FindBeanIchubResultPool

func NewIchubResultPool

func NewIchubResultPool() *IchubResultPool

Jump to

Keyboard shortcuts

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