From 5c8c4cc1dd9a9970158d95e1355645ae96a1d789 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 19 Sep 2022 16:48:25 -0400 Subject: [PATCH] *add 15 ms delay (found via trial/error) on stream writes since there appears to be a event loop based backlog preventing some streams from being processed, causing client detected timeouts --- src/rpc/connection.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpc/connection.ts b/src/rpc/connection.ts index 70763fd..4869625 100644 --- a/src/rpc/connection.ts +++ b/src/rpc/connection.ts @@ -65,6 +65,7 @@ export default class RPCConnection { break; } streamResp.data.data = chunk as unknown as Uint8Array; + await new Promise((resolve) => setTimeout(resolve, 15)); that.write(pack(streamResp)); }