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

Struct SlidingWindowStrategy

pkg/context/compression_strategy.go:21–23  ·  view source on GitHub ↗

SlidingWindowStrategy 滑动窗口策略 保留最近的 N 条消息,删除旧消息

Source from the content-addressed store, hash-verified

19// SlidingWindowStrategy 滑动窗口策略
20// 保留最近的 N 条消息,删除旧消息
21type SlidingWindowStrategy struct {
22 windowSize int // 窗口大小(消息数量)
23}
24
25// NewSlidingWindowStrategy 创建滑动窗口策略
26func NewSlidingWindowStrategy(windowSize int) *SlidingWindowStrategy {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected