Skip to content

Commit c8afaba

Browse files
committed
change minimal sample's fetch helper to artificially delay
the delay is longer that the threadpool worker's semaphore timeout, in order to validate that the worker stays alive while there are unsettled promises
1 parent 50c0f1a commit c8afaba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

2-
export function responseText(response) /* Promise<string> */ {
3-
return response.text();
2+
function delay(timeoutMs) {
3+
return new Promise(resolve => setTimeout(resolve, timeoutMs));
4+
}
5+
6+
export async function responseText(response) /* Promise<string> */ {
7+
console.log("artificially waiting for response for 25 seconds");
8+
await delay(25000);
9+
console.log("artificial waiting done");
10+
return await response.text();
411
}

0 commit comments

Comments
 (0)