diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-08-19 10:14:56 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-19 10:14:56 +0530 |
commit | 8bdcec1c84636aa00bf7444539e68b49d79b1fbf (patch) | |
tree | 77fb6ea2aadda9b50a839ac858f0a11073c06521 /cli/bench | |
parent | cd21cff29942f24ba7d38287186cce64d0e84e56 (diff) |
fix(ext/flash): concurrent response streams (#15493)
Diffstat (limited to 'cli/bench')
-rw-r--r-- | cli/bench/http/deno_http_flash_ops.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/bench/http/deno_http_flash_ops.js b/cli/bench/http/deno_http_flash_ops.js index 1b833e7f7..40ca25ff1 100644 --- a/cli/bench/http/deno_http_flash_ops.js +++ b/cli/bench/http/deno_http_flash_ops.js @@ -25,13 +25,15 @@ function respond(token, response) { const response = encode( "HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\nHello World", ); +let offset = 0; while (true) { let token = nextRequest(); if (token === 0) token = await opAsync("op_flash_next_async", serverId); - for (let i = 0; i < token; i++) { + for (let i = offset; i < offset + token; i++) { respond( i, response, ); } + offset += token; } |