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.
13 lines
841 B
Go
13 lines
841 B
Go
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
|
||
} |