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