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:
@@ -31,11 +31,12 @@ type Event struct {
|
||||
|
||||
// Client 表示一个WebSocket客户端连接
|
||||
type Client struct {
|
||||
ID uint64
|
||||
UserID string
|
||||
Send chan []byte
|
||||
Quit chan struct{}
|
||||
PendingAcks map[string]time.Time
|
||||
ID uint64
|
||||
UserID string
|
||||
Send chan []byte
|
||||
Quit chan struct{}
|
||||
PendingAcks map[string]time.Time
|
||||
CompressEnabled bool // 客户端是否启用 gzip 压缩
|
||||
}
|
||||
|
||||
// ErrConnectionLimit 连接数限制错误
|
||||
|
||||
Reference in New Issue
Block a user