pool

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteBufferPool

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

ByteBufferPool 字节缓冲池

func NewByteBufferPool

func NewByteBufferPool(metrics *observability.MetricsRecorder) *ByteBufferPool

NewByteBufferPool 创建字节缓冲池

func (*ByteBufferPool) Get

func (p *ByteBufferPool) Get() []byte

Get 获取字节缓冲

func (*ByteBufferPool) Put

func (p *ByteBufferPool) Put(buf []byte)

Put 归还字节缓冲

func (*ByteBufferPool) ReportMetrics added in v0.3.1

func (p *ByteBufferPool) ReportMetrics(ctx context.Context)

ReportMetrics 报告缓冲池指标

type MessagePool

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

MessagePool 消息对象池

func NewMessagePool

func NewMessagePool(metrics *observability.MetricsRecorder) *MessagePool

NewMessagePool 创建消息池

func (*MessagePool) Get

func (p *MessagePool) Get() *message.Message

Get 获取消息对象

func (*MessagePool) Put

func (p *MessagePool) Put(msg *message.Message)

Put 归还消息对象

func (*MessagePool) ReportMetrics added in v0.3.1

func (p *MessagePool) ReportMetrics(ctx context.Context)

ReportMetrics 定期计算和上报池统计信息

Jump to

Keyboard shortcuts

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