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:
@@ -431,6 +431,7 @@ func (r *Router) setupRoutes() {
|
||||
conversations.PUT("/:id/notification_muted", r.messageHandler.HandleSetConversationNotificationMuted) // 免打扰设置
|
||||
conversations.GET("/unread/count", r.messageHandler.GetUnreadCount) // 未读数
|
||||
conversations.GET("/sync-data", r.messageHandler.HandleGetSyncData) // 同步元数据
|
||||
conversations.GET("/sync", r.messageHandler.HandleGetSyncByVersion) // 增量同步(版本日志)
|
||||
conversations.POST("/:id/typing", r.messageHandler.HandleTyping) // 输入状态
|
||||
conversations.DELETE("/:id/self", r.messageHandler.HandleDeleteConversationForSelf) // 删除会话(仅自己)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user