1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

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

This commit is contained in:
Asher Gomez 2024-08-31 09:46:02 +10:00 committed by GitHub
parent 8e478a1a7d
commit a527b3a5de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1 additions and 36 deletions

View file

@ -63,10 +63,6 @@ async function write(rid, data) {
return await core.write(rid, data); return await core.write(rid, data);
} }
function shutdown(rid) {
return core.shutdown(rid);
}
async function resolveDns(query, recordType, options) { async function resolveDns(query, recordType, options) {
let cancelRid; let cancelRid;
let abortHandler; let abortHandler;
@ -164,7 +160,7 @@ class Conn {
} }
closeWrite() { closeWrite() {
return shutdown(this.#rid); return core.shutdown(this.#rid);
} }
get readable() { get readable() {
@ -647,7 +643,6 @@ export {
Listener, Listener,
listenOptionApiName, listenOptionApiName,
resolveDns, resolveDns,
shutdown,
TcpConn, TcpConn,
UnixConn, UnixConn,
validatePort, validatePort,

View file

@ -528,22 +528,4 @@ declare namespace Deno {
conn: TcpConn, conn: TcpConn,
options?: StartTlsOptions, options?: StartTlsOptions,
): Promise<TlsConn>; ): 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>;
} }

View file

@ -186,14 +186,6 @@ const denoNs = {
connectTls: tls.connectTls, connectTls: tls.connectTls,
listenTls: tls.listenTls, listenTls: tls.listenTls,
startTls: tls.startTls, startTls: tls.startTls,
shutdown(rid) {
internals.warnOnDeprecatedApi(
"Deno.shutdown()",
new Error().stack,
"Use `Deno.Conn.closeWrite()` instead.",
);
net.shutdown(rid);
},
fstatSync(rid) { fstatSync(rid) {
internals.warnOnDeprecatedApi( internals.warnOnDeprecatedApi(
"Deno.fstatSync()", "Deno.fstatSync()",

View file

@ -948,7 +948,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
delete Deno.readSync; delete Deno.readSync;
delete Deno.seek; delete Deno.seek;
delete Deno.seekSync; delete Deno.seekSync;
delete Deno.shutdown;
delete Deno.writeAll; delete Deno.writeAll;
delete Deno.writeAllSync; delete Deno.writeAllSync;
delete Deno.write; delete Deno.write;
@ -1136,7 +1135,6 @@ function bootstrapWorkerRuntime(
delete Deno.readSync; delete Deno.readSync;
delete Deno.seek; delete Deno.seek;
delete Deno.seekSync; delete Deno.seekSync;
delete Deno.shutdown;
delete Deno.writeAll; delete Deno.writeAll;
delete Deno.writeAllSync; delete Deno.writeAllSync;
delete Deno.write; delete Deno.write;

View file

@ -23,7 +23,6 @@ console.log("Deno.read is", Deno.read);
console.log("Deno.readSync is", Deno.readSync); console.log("Deno.readSync is", Deno.readSync);
console.log("Deno.seek is", Deno.seek); console.log("Deno.seek is", Deno.seek);
console.log("Deno.seekSync is", Deno.seekSync); console.log("Deno.seekSync is", Deno.seekSync);
console.log("Deno.shutdown is", Deno.shutdown);
console.log("Deno.writeAll is", Deno.writeAll); console.log("Deno.writeAll is", Deno.writeAll);
console.log("Deno.writeAllSync is", Deno.writeAllSync); console.log("Deno.writeAllSync is", Deno.writeAllSync);
console.log("Deno.write is", Deno.write); console.log("Deno.write is", Deno.write);

View file

@ -20,7 +20,6 @@ Deno.read is undefined
Deno.readSync is undefined Deno.readSync is undefined
Deno.seek is undefined Deno.seek is undefined
Deno.seekSync is undefined Deno.seekSync is undefined
Deno.shutdown is undefined
Deno.writeAll is undefined Deno.writeAll is undefined
Deno.writeAllSync is undefined Deno.writeAllSync is undefined
Deno.write is undefined Deno.write is undefined