Files
backend/internal/config/push_worker.go
lan 6bf87fec46
All checks were successful
Build Backend / build (push) Successful in 4m20s
Build Backend / build-docker (push) Successful in 1m7s
feat(chat): implement sequence pre-allocation, versioned sync, and push worker
Introduce several performance and synchronization enhancements:
- Implement `SeqBufferManager` to allow sequence number pre-allocation via Redis Lua scripts, reducing atomic increment overhead.
- Add `PushWorker` to handle asynchronous message pushing using Redis Streams.
- Implement incremental conversation synchronization via `ConversationVersionLog` to allow clients to fetch only recent changes.
- Add support for Gzip compression in WebSocket communications to reduce bandwidth usage.
- Update dependency injection and configuration to support these new components.
2026-05-17 23:38:04 +08:00

13 lines
841 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package config
// PushWorkerConfig 推送 Worker 配置Redis Stream 异步推送)
type PushWorkerConfig struct {
Enabled bool `mapstructure:"enabled"`
Stream string `mapstructure:"stream"` // Redis Stream 名称,默认 "msg_push"
Group string `mapstructure:"group"` // Consumer Group 名称,默认 "push_worker"
BatchSize int `mapstructure:"batch_size"` // XREADGROUP 每次读取条数,默认 50
PollTimeoutMs int `mapstructure:"poll_timeout_ms"` // XREADGROUP BLOCK 超时 ms默认 2000
MaxRetries int `mapstructure:"max_retries"` // 消息最大重试次数,默认 3
MaxStreamLen int64 `mapstructure:"max_stream_len"` // Stream MAXLEN默认 100000
IdleTimeoutMs int64 `mapstructure:"idle_timeout_ms"` // XPENDING 空闲超时 ms默认 30000
}