diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-12 21:55:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 15:55:05 -0400 |
commit | 46b1c653c0c433932908b7610f60b409af134c76 (patch) | |
tree | 00d8b59c8c4e9b90538d548ebd828d2b3f94d4fd /core/examples/http_bench_json_ops.js | |
parent | a20504642d083172f297543f9788b128e9c2e0bc (diff) |
refactor(deno): remove concept of bin & json ops (#10145)
Diffstat (limited to 'core/examples/http_bench_json_ops.js')
-rw-r--r-- | core/examples/http_bench_json_ops.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/examples/http_bench_json_ops.js b/core/examples/http_bench_json_ops.js index f8ac05353..687be7ec1 100644 --- a/core/examples/http_bench_json_ops.js +++ b/core/examples/http_bench_json_ops.js @@ -11,12 +11,12 @@ const responseBuf = new Uint8Array( /** Listens on 0.0.0.0:4500, returns rid. */ function listen() { - return Deno.core.jsonOpSync("listen"); + return Deno.core.opSync("listen"); } /** Accepts a connection, returns rid. */ function accept(serverRid) { - return Deno.core.jsonOpAsync("accept", serverRid); + return Deno.core.opAsync("accept", serverRid); } /** @@ -24,16 +24,16 @@ function accept(serverRid) { * Returns bytes read. */ function read(rid, data) { - return Deno.core.jsonOpAsync("read", rid, data); + return Deno.core.opAsync("read", rid, data); } /** Writes a fixed HTTP response to the socket rid. Returns bytes written. */ function write(rid, data) { - return Deno.core.jsonOpAsync("write", rid, data); + return Deno.core.opAsync("write", rid, data); } function close(rid) { - Deno.core.jsonOpSync("close", rid); + Deno.core.opSync("close", rid); } async function serve(rid) { @@ -58,7 +58,7 @@ async function main() { Deno.core.registerErrorClass("Error", Error); const listenerRid = listen(); - Deno.core.print(`http_bench_json_ops listening on http://127.0.0.1:4544/\n`); + Deno.core.print(`http_bench_ops listening on http://127.0.0.1:4544/\n`); while (true) { const rid = await accept(listenerRid); |