summaryrefslogtreecommitdiff
path: root/core/examples/http_bench.js
diff options
context:
space:
mode:
authorValentin Anger <syrupthinker@gryphno.de>2020-06-01 20:20:47 +0200
committerGitHub <noreply@github.com>2020-06-01 14:20:47 -0400
commitbecbb56b19e96e4dd72b861217a855fba953d290 (patch)
treed9e99771c537ef87a4a945f0120775c337ef90aa /core/examples/http_bench.js
parent12d741c2fe453625d510313beaa2e1c282784c00 (diff)
feat(core): Ops can take several zero copy buffers (#4788)
Diffstat (limited to 'core/examples/http_bench.js')
-rw-r--r--core/examples/http_bench.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/examples/http_bench.js b/core/examples/http_bench.js
index d9878cbe7..a893dab40 100644
--- a/core/examples/http_bench.js
+++ b/core/examples/http_bench.js
@@ -36,18 +36,18 @@ const scratchBytes = new Uint8Array(
);
assert(scratchBytes.byteLength === 3 * 4);
-function send(promiseId, opId, rid, zeroCopy = null) {
+function send(promiseId, opId, rid, ...zeroCopy) {
scratch32[0] = promiseId;
scratch32[1] = rid;
scratch32[2] = -1;
- return Deno.core.dispatch(opId, scratchBytes, zeroCopy);
+ return Deno.core.dispatch(opId, scratchBytes, ...zeroCopy);
}
/** Returns Promise<number> */
-function sendAsync(opId, rid, zeroCopy = null) {
+function sendAsync(opId, rid, ...zeroCopy) {
const promiseId = nextPromiseId++;
const p = createResolvable();
- const buf = send(promiseId, opId, rid, zeroCopy);
+ const buf = send(promiseId, opId, rid, ...zeroCopy);
if (buf) {
const record = recordFromBuf(buf);
// Sync result.