diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-01-13 01:17:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 16:17:31 -0800 |
commit | 8142496c571e7a5e42f2a2886fe005c27d96f616 (patch) | |
tree | a4e9a1d152f4738f4667995ddc735309be74deb2 /cli/dts | |
parent | 8d5af6ca5264201be1cb04b0bb1a0b88ce5166da (diff) |
feat: stabilize Deno.shutdown() and Conn#closeWrite()
Closes: #9099
Diffstat (limited to 'cli/dts')
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 18 | ||||
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 26 |
2 files changed, 13 insertions, 31 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 736f99f0d..8026d934a 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -1711,11 +1711,7 @@ declare namespace Deno { /** The resource ID of the connection. */ readonly rid: number; /** Shuts down (`shutdown(2)`) the writing side of the TCP connection. Most - * callers should just use `close()`. - * - * **Unstable** because of lack of testing and because Deno.shutdown is also - * unstable. - * */ + * callers should just use `close()`. */ closeWrite(): void; } @@ -1809,6 +1805,18 @@ declare namespace Deno { */ export function connectTls(options: ConnectTlsOptions): Promise<Conn>; + /** 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); + * ``` + */ + export function shutdown(rid: number): Promise<void>; + export interface Metrics { opsDispatched: number; opsDispatchedSync: number; diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 0eaed73ba..1de7ed8cc 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -835,32 +835,6 @@ declare namespace Deno { mtime: number | Date, ): Promise<void>; - /** **UNSTABLE**: Under consideration to remove `ShutdownMode` entirely. - * - * Corresponds to `SHUT_RD`, `SHUT_WR`, `SHUT_RDWR` on POSIX-like systems. - * - * See: http://man7.org/linux/man-pages/man2/shutdown.2.html */ - export enum ShutdownMode { - Read = 0, - Write, - ReadWrite, // TODO(ry) panics on ReadWrite. - } - - /** **UNSTABLE**: Both the `how` parameter and `ShutdownMode` enum are under - * consideration for removal. - * - * Shutdown socket send and receive operations. - * - * Matches behavior of POSIX shutdown(3). - * - * ```ts - * const listener = Deno.listen({ port: 80 }); - * const conn = await listener.accept(); - * Deno.shutdown(conn.rid, Deno.ShutdownMode.Write); - * ``` - */ - export function shutdown(rid: number, how: ShutdownMode): Promise<void>; - /** **UNSTABLE**: new API, yet to be vetted. * * A generic transport listener for message-oriented protocols. */ |