diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-05-19 15:14:40 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-19 15:14:40 -0600 |
commit | 7f5290b6946fececec5ec3acd85e67cd16960b8e (patch) | |
tree | 45e561e24f9dcf38b23b4ed88c3e14f56808c652 /cli/tsc | |
parent | af72a9c6576cab16128a89d3c9cd5f57cd0d2504 (diff) |
feat(ext/http): ref/unref for server (#19197)
Add `ref` and `unref` to return value from `Deno.serve`. Unblocks #3326.
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/dts/lib.deno.unstable.d.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index c0c0d16ad..70d7ef7c4 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1312,7 +1312,19 @@ declare namespace Deno { * the signal passed to {@linkcode ServeOptions.signal}. */ finished: Promise<void>; + + /** + * Make the server block the event loop from finishing. + * + * Note: the server blocks the event loop from finishing by default. + * This method is only meaningful after `.unref()` is called. + */ + ref(): void; + + /** Make the server not block the event loop from finishing. */ + unref(): void; } + /** **UNSTABLE**: New API, yet to be vetted. * * Serves HTTP requests with the given handler. |