Tweak socket work cadence

This commit is contained in:
Jonathan Staab
2023-07-20 10:18:16 -07:00
parent 5cbb229708
commit e9d7ad166e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -93,7 +93,7 @@ export class Socket extends EventEmitter {
doWork = () => {
this.timeout = undefined
for (const [action, payload] of this.queue.splice(0, 50)) {
for (const [action, payload] of this.queue.splice(0, 10)) {
if (action === 'receive') {
this.receiveMessage(payload)
}
@@ -111,7 +111,7 @@ export class Socket extends EventEmitter {
}
enqueueWork = () => {
if (!this.timeout && this.queue.length > 0) {
this.timeout = setTimeout(() => this.doWork(), 50) as NodeJS.Timeout
this.timeout = setTimeout(() => this.doWork(), 100) as NodeJS.Timeout
}
}
}