aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-12 19:30:10 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-12 19:38:27 -0800
commit734b5b89da07fa074ea1c2a1013f32a56fc58637 (patch)
tree5a7935017a1ef6378e87b648b3065f2dd865a1e3
parent490814aa35163bf8d8f3a08ddd8d4edded9c8a3d (diff)
downloadbun-734b5b89da07fa074ea1c2a1013f32a56fc58637.tar.gz
bun-734b5b89da07fa074ea1c2a1013f32a56fc58637.tar.zst
bun-734b5b89da07fa074ea1c2a1013f32a56fc58637.zip
Add `closeActiveConnections` option to types
-rw-r--r--packages/bun-types/bun.d.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts
index 41deb9410..98e385b98 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<Options extends SocketOptions = SocketOptions> {
- stop(): void;
+ stop(closeActiveConnections?: boolean): void;
ref(): void;
unref(): void;
reload(options: Pick<Partial<Options>, "socket">): void;