Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BSONFactory ¶
type BSONFactory struct {
PoolSize int
}
BSONFactory 实现 ObjectFactory 接口,用于创建和重置 BSONBatch 对象
type BatchPool ¶
BatchPool 泛型对象池
func NewBatchPool ¶
func NewBatchPool[T any](factory ObjectFactory[T], poolSize int) *BatchPool[T]
NewBatchPool 初始化一个泛型对象池
func (*BatchPool[T]) SetPoolSize ¶
func (bp *BatchPool[T]) SetPoolSize(factory ObjectFactory[T], poolSize int)
SetPoolSize 更新池子的大小
type BufferFactory ¶
type BufferFactory struct {
BufferSize int
}
BufferFactory 实现 ObjectFactory 接口,用于创建和重置缓冲区
type ObjectFactory ¶
type ObjectFactory[T any] interface { New() T Reset(T) }
ObjectFactory 定义对象创建和重置方法的接口
Click to show internal directories.
Click to hide internal directories.