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.
This commit is contained in:
8
internal/config/version_log.go
Normal file
8
internal/config/version_log.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package config
|
||||
|
||||
// VersionLogConfig 版本日志增量同步配置
|
||||
type VersionLogConfig struct {
|
||||
Enabled bool `mapstructure:"enabled"`
|
||||
SyncLimit int `mapstructure:"sync_limit"` // 单次同步最大返回条数
|
||||
MaxSyncGap int64 `mapstructure:"max_sync_gap"` // 超过此版本差距建议全量同步
|
||||
}
|
||||
Reference in New Issue
Block a user