From 734b5b89da07fa074ea1c2a1013f32a56fc58637 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Thu, 12 Jan 2023 19:30:10 -0800 Subject: [PATCH] Add `closeActiveConnections` option to types --- packages/bun-types/bun.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index 41deb9410e..98e385b98c 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -1592,11 +1592,12 @@ declare module "bun" { /** * Stop listening to prevent new connections from being accepted. * - * It does not close existing connections. + * By default, it does not cancel in-flight requests or websockets. That means it may take some time before all network activity stops. * - * It may take a second or two to actually stop. + * @param closeActiveConnections Immediately terminate in-flight requests, websockets, and stop accepting new connections. + * @default false */ - stop(): void; + stop(closeActiveConnections?: boolean): void; /** * Update the `fetch` and `error` handlers without restarting the server. @@ -2741,7 +2742,7 @@ declare module "bun" { } interface SocketListener { - stop(): void; + stop(closeActiveConnections?: boolean): void; ref(): void; unref(): void; reload(options: Pick, "socket">): void;