Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(net): remove Deno.shutdown() #25253

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions ext/net/01_net.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ async function write(rid, data) {
return await core.write(rid, data);
}

function shutdown(rid) {
return core.shutdown(rid);
}

async function resolveDns(query, recordType, options) {
let cancelRid;
let abortHandler;
Expand Down Expand Up @@ -164,7 +160,7 @@ class Conn {
}

closeWrite() {
return shutdown(this.#rid);
return core.shutdown(this.#rid);
}

get readable() {
Expand Down Expand Up @@ -647,7 +643,6 @@ export {
Listener,
listenOptionApiName,
resolveDns,
shutdown,
TcpConn,
UnixConn,
validatePort,
Expand Down
18 changes: 0 additions & 18 deletions ext/net/lib.deno_net.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,22 +528,4 @@ declare namespace Deno {
conn: TcpConn,
options?: StartTlsOptions,
): Promise<TlsConn>;

/** Shutdown socket send operations.
*
* Matches behavior of POSIX shutdown(3).
*
* ```ts
* const listener = Deno.listen({ port: 80 });
* const conn = await listener.accept();
* Deno.shutdown(conn.rid);
* ```
*
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*
* @category Network
*/
export function shutdown(rid: number): Promise<void>;
}
8 changes: 0 additions & 8 deletions runtime/js/90_deno_ns.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,6 @@ const denoNs = {
connectTls: tls.connectTls,
listenTls: tls.listenTls,
startTls: tls.startTls,
shutdown(rid) {
internals.warnOnDeprecatedApi(
"Deno.shutdown()",
new Error().stack,
"Use `Deno.Conn.closeWrite()` instead.",
);
net.shutdown(rid);
},
fstatSync(rid) {
internals.warnOnDeprecatedApi(
"Deno.fstatSync()",
Expand Down
2 changes: 0 additions & 2 deletions runtime/js/99_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
delete Deno.resources;
delete Deno.seek;
delete Deno.seekSync;
delete Deno.shutdown;
delete Deno.writeAll;
delete Deno.writeAllSync;
delete Deno.write;
Expand Down Expand Up @@ -1144,7 +1143,6 @@ function bootstrapWorkerRuntime(
delete Deno.resources;
delete Deno.seek;
delete Deno.seekSync;
delete Deno.shutdown;
delete Deno.writeAll;
delete Deno.writeAllSync;
delete Deno.write;
Expand Down
1 change: 0 additions & 1 deletion tests/specs/future/runtime_api/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ console.log("Deno.readSync is", Deno.readSync);
console.log("Deno.resources is", Deno.resources);
console.log("Deno.seek is", Deno.seek);
console.log("Deno.seekSync is", Deno.seekSync);
console.log("Deno.shutdown is", Deno.shutdown);
console.log("Deno.writeAll is", Deno.writeAll);
console.log("Deno.writeAllSync is", Deno.writeAllSync);
console.log("Deno.write is", Deno.write);
Expand Down
1 change: 0 additions & 1 deletion tests/specs/future/runtime_api/main.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Deno.readSync is undefined
Deno.resources is undefined
Deno.seek is undefined
Deno.seekSync is undefined
Deno.shutdown is undefined
Deno.writeAll is undefined
Deno.writeAllSync is undefined
Deno.write is undefined
Expand Down