chore(runtime): deprecate Deno.copy (#11369)

This commit is contained in:
Luca Casonato 2021-07-12 19:44:42 +02:00 committed by GitHub
parent 00484d24ba
commit 51e0bfda3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 29 additions and 15 deletions

View file

@ -1,5 +1,7 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
// Used for benchmarking Deno's tcp proxy performance.
import { copy } from "../../test_util/std/io/util.ts";
const addr = Deno.args[0] || "127.0.0.1:4500";
const originAddr = Deno.args[1] || "127.0.0.1:4501";
@ -14,7 +16,7 @@ async function handle(conn: Deno.Conn): Promise<void> {
port: Number(originPort),
});
try {
await Promise.all([Deno.copy(conn, origin), Deno.copy(origin, conn)]);
await Promise.all([copy(conn, origin), copy(origin, conn)]);
} catch (e) {
if (
!(e instanceof Deno.errors.BrokenPipe) &&