MCPcopy Create free account
hub / github.com/astercloud/aster / PriorityBasedStrategy

Struct PriorityBasedStrategy

pkg/context/compression_strategy.go:93–96  ·  view source on GitHub ↗

PriorityBasedStrategy 基于优先级的压缩策略 优先保留高优先级消息

Source from the content-addressed store, hash-verified

91// PriorityBasedStrategy 基于优先级的压缩策略
92// 优先保留高优先级消息
93type PriorityBasedStrategy struct {
94 targetSize int // 目标消息数
95 priorityCalculator PriorityCalculator // 优先级计算器
96}
97
98// NewPriorityBasedStrategy 创建基于优先级的策略
99func NewPriorityBasedStrategy(targetSize int, calculator PriorityCalculator) *PriorityBasedStrategy {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected