Reduce socket batch size to prevent ui lockup when using non-wasm event validation

This commit is contained in:
Jon Staab
2025-10-28 08:33:17 -07:00
parent 7d8f5e05b4
commit 8b8e3a6a51
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -31,6 +31,8 @@ export type SocketEvents = {
}
export class Socket extends EventEmitter {
static batchSize = 10
auth: AuthState
status = SocketStatus.Closed
@@ -44,7 +46,7 @@ export class Socket extends EventEmitter {
this.auth = new AuthState(this)
this._sendQueue = new TaskQueue<ClientMessage>({
batchSize: 50,
batchSize: Socket.batchSize,
processItem: (message: ClientMessage) => {
this._ws?.send(JSON.stringify(message))
this.emit(SocketEvent.Send, message, this.url)
@@ -52,7 +54,7 @@ export class Socket extends EventEmitter {
})
this._recvQueue = new TaskQueue<RelayMessage>({
batchSize: 50,
batchSize: Socket.batchSize,
processItem: (message: RelayMessage) => {
this.emit(SocketEvent.Receive, message, this.url)
},