@encore.dev/sdk 2.0.0-beta.15 → 2.0.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +111 -101
  2. package/app_meta.ts +56 -54
  3. package/config/config.ts +60 -57
  4. package/config/secrets.ts +45 -52
  5. package/config/value.ts +23 -26
  6. package/cron/mod.ts +28 -29
  7. package/dist/app_meta.d.ts +52 -50
  8. package/dist/app_meta.d.ts.map +1 -1
  9. package/dist/app_meta.js +2 -2
  10. package/dist/app_meta.js.map +1 -1
  11. package/dist/config/config.d.ts +58 -55
  12. package/dist/config/config.d.ts.map +1 -1
  13. package/dist/config/config.js +8 -9
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/secrets.d.ts +45 -52
  16. package/dist/config/secrets.d.ts.map +1 -1
  17. package/dist/config/secrets.js +8 -9
  18. package/dist/config/secrets.js.map +1 -1
  19. package/dist/config/value.d.ts +20 -23
  20. package/dist/config/value.d.ts.map +1 -1
  21. package/dist/config/value.js +20 -23
  22. package/dist/config/value.js.map +1 -1
  23. package/dist/cron/mod.d.ts +26 -27
  24. package/dist/cron/mod.d.ts.map +1 -1
  25. package/dist/cron/mod.js +13 -14
  26. package/dist/cron/mod.js.map +1 -1
  27. package/dist/frontends/mod.d.ts +20 -19
  28. package/dist/frontends/mod.d.ts.map +1 -1
  29. package/dist/frontends/mod.js +20 -19
  30. package/dist/frontends/mod.js.map +1 -1
  31. package/dist/gateway/errors.d.ts +28 -30
  32. package/dist/gateway/errors.d.ts.map +1 -1
  33. package/dist/gateway/errors.js +29 -31
  34. package/dist/gateway/errors.js.map +1 -1
  35. package/dist/gateway/match.d.ts +54 -54
  36. package/dist/gateway/match.d.ts.map +1 -1
  37. package/dist/gateway/match.js +56 -56
  38. package/dist/gateway/match.js.map +1 -1
  39. package/dist/gateway/middleware.d.ts +62 -64
  40. package/dist/gateway/middleware.d.ts.map +1 -1
  41. package/dist/gateway/middleware.js +1 -1
  42. package/dist/gateway/middleware.js.map +1 -1
  43. package/dist/gateway/mod.d.ts +64 -67
  44. package/dist/gateway/mod.d.ts.map +1 -1
  45. package/dist/gateway/mod.js +72 -76
  46. package/dist/gateway/mod.js.map +1 -1
  47. package/dist/gateway/request.d.ts +138 -134
  48. package/dist/gateway/request.d.ts.map +1 -1
  49. package/dist/gateway/request.js +117 -108
  50. package/dist/gateway/request.js.map +1 -1
  51. package/dist/gateway/serve.d.ts +29 -34
  52. package/dist/gateway/serve.d.ts.map +1 -1
  53. package/dist/gateway/serve.js +51 -56
  54. package/dist/gateway/serve.js.map +1 -1
  55. package/dist/gateways/mod.d.ts +23 -21
  56. package/dist/gateways/mod.d.ts.map +1 -1
  57. package/dist/gateways/mod.js +25 -23
  58. package/dist/gateways/mod.js.map +1 -1
  59. package/dist/internal/runtime/napi/napi.cjs +1 -1
  60. package/dist/internal/runtime/napi/napi.d.cts +10 -3
  61. package/dist/internal/runtime/shutdown.d.ts +75 -57
  62. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  63. package/dist/internal/runtime/shutdown.js +88 -84
  64. package/dist/internal/runtime/shutdown.js.map +1 -1
  65. package/dist/log/logger.d.ts +43 -37
  66. package/dist/log/logger.d.ts.map +1 -1
  67. package/dist/log/logger.js +26 -25
  68. package/dist/log/logger.js.map +1 -1
  69. package/dist/metrics/mod.d.ts +133 -114
  70. package/dist/metrics/mod.d.ts.map +1 -1
  71. package/dist/metrics/mod.js +109 -101
  72. package/dist/metrics/mod.js.map +1 -1
  73. package/dist/otel.d.ts +6 -3
  74. package/dist/otel.d.ts.map +1 -1
  75. package/dist/otel.js +6 -3
  76. package/dist/otel.js.map +1 -1
  77. package/dist/pubsub/subscription.d.ts +88 -116
  78. package/dist/pubsub/subscription.d.ts.map +1 -1
  79. package/dist/pubsub/subscription.js +14 -17
  80. package/dist/pubsub/subscription.js.map +1 -1
  81. package/dist/pubsub/topic.d.ts +86 -113
  82. package/dist/pubsub/topic.d.ts.map +1 -1
  83. package/dist/pubsub/topic.js +68 -82
  84. package/dist/pubsub/topic.js.map +1 -1
  85. package/dist/reqctx/mod.d.ts +83 -86
  86. package/dist/reqctx/mod.d.ts.map +1 -1
  87. package/dist/reqctx/mod.js +39 -41
  88. package/dist/reqctx/mod.js.map +1 -1
  89. package/dist/services/index.d.ts +76 -75
  90. package/dist/services/index.d.ts.map +1 -1
  91. package/dist/services/index.js +73 -71
  92. package/dist/services/index.js.map +1 -1
  93. package/dist/shutdown/mod.d.ts +26 -25
  94. package/dist/shutdown/mod.d.ts.map +1 -1
  95. package/dist/shutdown/mod.js +26 -25
  96. package/dist/shutdown/mod.js.map +1 -1
  97. package/dist/storage/clickhouse/database.d.ts +113 -115
  98. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  99. package/dist/storage/clickhouse/database.js +65 -79
  100. package/dist/storage/clickhouse/database.js.map +1 -1
  101. package/dist/storage/clickhouse/errors.d.ts +25 -26
  102. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  103. package/dist/storage/clickhouse/errors.js +15 -17
  104. package/dist/storage/clickhouse/errors.js.map +1 -1
  105. package/dist/storage/clickhouse/mod.d.ts +10 -10
  106. package/dist/storage/clickhouse/mod.js +10 -10
  107. package/dist/storage/objects/bucket.d.ts +196 -225
  108. package/dist/storage/objects/bucket.d.ts.map +1 -1
  109. package/dist/storage/objects/bucket.js +71 -84
  110. package/dist/storage/objects/bucket.js.map +1 -1
  111. package/dist/storage/objects/error.d.ts +4 -4
  112. package/dist/storage/objects/error.js +4 -4
  113. package/dist/storage/postgres/database.d.ts +124 -149
  114. package/dist/storage/postgres/database.d.ts.map +1 -1
  115. package/dist/storage/postgres/database.js +98 -135
  116. package/dist/storage/postgres/database.js.map +1 -1
  117. package/dist/storage/postgres/errors.d.ts +42 -48
  118. package/dist/storage/postgres/errors.d.ts.map +1 -1
  119. package/dist/storage/postgres/errors.js +44 -51
  120. package/dist/storage/postgres/errors.js.map +1 -1
  121. package/dist/storage/postgres/interval.d.ts +19 -19
  122. package/dist/storage/postgres/interval.d.ts.map +1 -1
  123. package/dist/storage/postgres/interval.js +21 -21
  124. package/dist/storage/postgres/interval.js.map +1 -1
  125. package/dist/storage/redis/bitfield.d.ts +48 -23
  126. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  127. package/dist/storage/redis/bitfield.js +38 -19
  128. package/dist/storage/redis/bitfield.js.map +1 -1
  129. package/dist/storage/redis/command.d.ts +16 -12
  130. package/dist/storage/redis/command.d.ts.map +1 -1
  131. package/dist/storage/redis/command.js +16 -12
  132. package/dist/storage/redis/command.js.map +1 -1
  133. package/dist/storage/redis/commands.d.ts +99 -100
  134. package/dist/storage/redis/commands.d.ts.map +1 -1
  135. package/dist/storage/redis/commands.js +84 -85
  136. package/dist/storage/redis/commands.js.map +1 -1
  137. package/dist/storage/redis/database.d.ts +138 -122
  138. package/dist/storage/redis/database.d.ts.map +1 -1
  139. package/dist/storage/redis/database.js +120 -101
  140. package/dist/storage/redis/database.js.map +1 -1
  141. package/dist/storage/redis/mod.d.ts +52 -48
  142. package/dist/storage/redis/mod.d.ts.map +1 -1
  143. package/dist/storage/redis/mod.js +52 -48
  144. package/dist/storage/redis/mod.js.map +1 -1
  145. package/dist/storage/redis/options.d.ts +26 -24
  146. package/dist/storage/redis/options.d.ts.map +1 -1
  147. package/dist/storage/redis/options.js.map +1 -1
  148. package/dist/storage/redis/pubsub.d.ts +16 -16
  149. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  150. package/dist/storage/redis/pubsub.js +14 -14
  151. package/dist/storage/redis/pubsub.js.map +1 -1
  152. package/dist/storage/redis/reply.d.ts +80 -72
  153. package/dist/storage/redis/reply.d.ts.map +1 -1
  154. package/dist/storage/redis/reply.js +53 -46
  155. package/dist/storage/redis/reply.js.map +1 -1
  156. package/dist/storage/redis/scan.d.ts +4 -4
  157. package/dist/storage/redis/scan.d.ts.map +1 -1
  158. package/dist/storage/redis/scan.js +6 -6
  159. package/dist/storage/redis/scan.js.map +1 -1
  160. package/dist/storage/redis/script.d.ts +28 -21
  161. package/dist/storage/redis/script.d.ts.map +1 -1
  162. package/dist/storage/redis/script.js +29 -22
  163. package/dist/storage/redis/script.js.map +1 -1
  164. package/dist/storage/redis/target.d.ts +17 -1
  165. package/dist/storage/redis/target.d.ts.map +1 -1
  166. package/dist/storage/redis/target.js +30 -1
  167. package/dist/storage/redis/target.js.map +1 -1
  168. package/dist/storage/redis/wire.d.ts +6 -6
  169. package/dist/storage/redis/wire.d.ts.map +1 -1
  170. package/dist/storage/redis/wire.js +6 -6
  171. package/dist/storage/redis/wire.js.map +1 -1
  172. package/dist/testing/mod.d.ts +83 -88
  173. package/dist/testing/mod.d.ts.map +1 -1
  174. package/dist/testing/mod.js +75 -81
  175. package/dist/testing/mod.js.map +1 -1
  176. package/dist/testing/playwright.d.ts +28 -32
  177. package/dist/testing/playwright.d.ts.map +1 -1
  178. package/dist/testing/playwright.js +22 -27
  179. package/dist/testing/playwright.js.map +1 -1
  180. package/dist/testing/puppeteer.d.ts +11 -12
  181. package/dist/testing/puppeteer.d.ts.map +1 -1
  182. package/dist/testing/puppeteer.js +17 -18
  183. package/dist/testing/puppeteer.js.map +1 -1
  184. package/dist/testing/system.d.ts +72 -90
  185. package/dist/testing/system.d.ts.map +1 -1
  186. package/dist/testing/system.js +90 -107
  187. package/dist/testing/system.js.map +1 -1
  188. package/dist/tsconfig.build.tsbuildinfo +1 -1
  189. package/frontends/mod.test.ts +6 -2
  190. package/frontends/mod.ts +20 -19
  191. package/gateway/errors.ts +30 -32
  192. package/gateway/match.ts +61 -57
  193. package/gateway/middleware.ts +62 -64
  194. package/gateway/mod.ts +73 -76
  195. package/gateway/request.ts +143 -140
  196. package/gateway/serve.ts +58 -63
  197. package/gateways/mod.ts +25 -23
  198. package/internal/runtime/napi/napi.cjs +1 -1
  199. package/internal/runtime/napi/napi.d.cts +10 -3
  200. package/internal/runtime/shutdown.ts +113 -101
  201. package/log/logger.test.ts +8 -0
  202. package/log/logger.ts +48 -45
  203. package/metrics/mod.ts +138 -122
  204. package/otel.ts +6 -3
  205. package/package.json +1 -1
  206. package/pubsub/subscription.ts +93 -123
  207. package/pubsub/topic.ts +96 -130
  208. package/reqctx/mod.ts +83 -86
  209. package/services/index.ts +78 -78
  210. package/shutdown/mod.ts +26 -25
  211. package/storage/clickhouse/database.ts +115 -129
  212. package/storage/clickhouse/errors.ts +27 -29
  213. package/storage/clickhouse/mod.ts +10 -10
  214. package/storage/objects/bucket.ts +209 -239
  215. package/storage/objects/error.ts +4 -4
  216. package/storage/postgres/database.ts +131 -164
  217. package/storage/postgres/errors.ts +45 -52
  218. package/storage/postgres/interval.ts +21 -21
  219. package/storage/redis/bitfield.ts +51 -26
  220. package/storage/redis/command.ts +16 -12
  221. package/storage/redis/commands.ts +99 -100
  222. package/storage/redis/database.ts +145 -123
  223. package/storage/redis/mod.ts +52 -48
  224. package/storage/redis/options.ts +26 -24
  225. package/storage/redis/pubsub.ts +14 -14
  226. package/storage/redis/redis.test.ts +17 -2
  227. package/storage/redis/reply.ts +85 -77
  228. package/storage/redis/scan.ts +6 -6
  229. package/storage/redis/script.ts +29 -22
  230. package/storage/redis/target.ts +34 -1
  231. package/storage/redis/wire.ts +8 -8
  232. package/testing/mod.ts +99 -105
  233. package/testing/playwright.ts +32 -37
  234. package/testing/puppeteer.ts +22 -23
  235. package/testing/system.ts +117 -133
@@ -2,92 +2,110 @@
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
4
  import type { Runtime } from './napi/napi.cjs';
5
- /** A phase of Encore's shutdown.
5
+ /**
6
+ * Current phase of Encore's graceful shutdown:
6
7
  *
7
8
  * - `not-started`: shutdown has not begun.
8
- * - `started`: Pub/Sub intake has stopped; Encore waits for the message
9
- * handlers in flight, and for the app's holds.
10
- * - `cleanup`: Encore is closing its resources and flushing telemetry.
11
- * - `completed`: cleanup has finished, whatever its result. */
9
+ * - `started`: Pub/Sub intake has stopped; Encore is waiting for in-flight
10
+ * message handlers and application holds to finish.
11
+ * - `cleanup`: Encore is closing managed resources and flushing telemetry.
12
+ * - `completed`: cleanup has finished (whether it succeeded or timed out).
13
+ */
12
14
  export type ShutdownPhase = 'not-started' | 'started' | 'cleanup' | 'completed';
13
- /** How a completed shutdown went: `success` if cleanup finished within the
14
- * shutdown deadline, else `timeout`. A failed cleanup is a
15
- * {@link ShutdownError}. */
15
+ /**
16
+ * Outcome of a completed shutdown: `'success'` if cleanup finished within the
17
+ * shutdown deadline, or `'timeout'` if the deadline expired. A failed cleanup
18
+ * rejects with {@link ShutdownError}.
19
+ */
16
20
  export type ShutdownResult = 'success' | 'timeout';
17
- /** Encore's cleanup failed, or the shutdown was used before it began. */
21
+ /** Thrown when Encore's resource cleanup fails or a shutdown API is called invalidly. */
18
22
  export declare class ShutdownError extends Error {
19
23
  name: string;
20
24
  }
21
- /** Work the shutdown waits for before Encore cleans up: until it is
22
- * released, or the shutdown deadline passes. Releasing it twice is harmless.
23
- * As a `Disposable`, `using` releases it at the end of its scope. */
25
+ /**
26
+ * A hold that delays Encore resource cleanup until {@link release} is called
27
+ * or the shutdown deadline expires. Calling `release()` more than once is a
28
+ * no-op. Implements `Disposable` so `using` releases it automatically at the
29
+ * end of a scope.
30
+ */
24
31
  export interface ShutdownHold extends Disposable {
25
32
  release(): void;
26
33
  }
27
- /** What a shutdown callback is told. */
34
+ /** Context passed to an {@link onShutdown} callback. */
28
35
  export interface ShutdownContext {
29
- /** Aborts when cleanup begins, the callback done or not: the shutdown
30
- * deadline passed, or cleanup was forced. */
36
+ /** Aborts when resource cleanup begins (either because the shutdown deadline
37
+ * expired or because cleanup was forced), even if the callback is still running. */
31
38
  signal: AbortSignal;
32
- /** When the shutdown deadline passes, in milliseconds since the epoch, as
33
- * `Date.now()` counts them. */
39
+ /** Timestamp when the shutdown deadline expires, in milliseconds since the
40
+ * Unix epoch (matching `Date.now()`). */
34
41
  deadline: number;
35
42
  }
36
- /** Called when shutdown begins. Cleanup waits for what it returns to settle. */
43
+ /** Callback invoked when shutdown begins. Resource cleanup waits for any
44
+ * returned promise to settle (up to the shutdown deadline). */
37
45
  export type ShutdownCallback = (ctx: ShutdownContext) => void | Promise<void>;
38
- /** Aborts when shutdown begins: Encore takes no new Pub/Sub messages, and the
39
- * app should stop taking work too. */
46
+ /** Aborts as soon as shutdown begins: Encore stops accepting new Pub/Sub
47
+ * messages, and your application should stop accepting new work as well. */
40
48
  export declare const signal: AbortSignal;
41
- /** Sets the runtime the shutdown runs on. */
49
+ /** Sets the native runtime instance used to coordinate shutdown. */
42
50
  export declare function setShutdownRuntime(rt: Runtime): void;
43
- /** Holds the shutdown back: Encore cleans up once every hold is released, or
44
- * the shutdown deadline passes. A hold taken once the app has drained, or
45
- * cleanup has begun, comes released: cleanup does not wait for it. */
51
+ /**
52
+ * Delays Encore's resource cleanup until the returned hold is released or the
53
+ * shutdown deadline expires. If called after the application has already
54
+ * drained or cleanup has begun, returns an already-released hold and logs a
55
+ * warning.
56
+ */
46
57
  export declare function hold(): ShutdownHold;
47
- /** Holds the shutdown back until `work` settles. A rejection is logged. */
58
+ /** Delays resource cleanup until `work` settles. Any rejection is logged. */
48
59
  export declare function waitUntil(work: PromiseLike<unknown>): void;
49
- /** Calls `callback` when shutdown begins, or at once if it has, holding
50
- * cleanup back until it settles. Disposing of the returned value
51
- * unregisters it. */
60
+ /**
61
+ * Registers `callback` to run when shutdown begins (or immediately if shutdown
62
+ * has already begun), delaying resource cleanup until it settles. Disposing
63
+ * the returned handle unregisters the callback.
64
+ */
52
65
  export declare function onShutdown(callback: ShutdownCallback): Disposable;
53
- /** Registers `callback` as {@link onShutdown} does, as Encore's own: it
54
- * doesn't stop Encore from waiting for an app that handles the signal itself. */
66
+ /** Registers an Encore-internal shutdown callback without disabling automatic
67
+ * detection of application-owned signal handlers. */
55
68
  export declare function onShutdownInternal(callback: ShutdownCallback): Disposable;
56
- /** Begins the shutdown, once: Encore stops taking Pub/Sub messages,
57
- * {@link signal} aborts, and the {@link onShutdown} callbacks run. Encore
58
- * cleans up once every hold is released, or the shutdown deadline passes.
59
- * SIGTERM and SIGINT begin it, outside tests. */
69
+ /**
70
+ * Initiates graceful shutdown (idempotent): stops Pub/Sub intake, aborts
71
+ * {@link signal}, and invokes all registered {@link onShutdown} callbacks.
72
+ * Encore cleans up resources once every hold is released or the shutdown
73
+ * deadline expires. Outside tests, `SIGTERM` and `SIGINT` call this
74
+ * automatically.
75
+ */
60
76
  export declare function begin(): void;
61
- /** The shutdown's phase now. */
77
+ /** Returns the current shutdown phase. */
62
78
  export declare function phase(): ShutdownPhase;
63
- /** Resolves once the shutdown has begun and Pub/Sub intake has stopped.
64
- * Waiting does not keep the process alive. */
79
+ /** Resolves once shutdown has begun and Pub/Sub intake has stopped. Awaiting
80
+ * this promise does not keep the event loop alive. */
65
81
  export declare function started(): Promise<void>;
66
- /** Resolves once cleanup begins: the app drained, the shutdown deadline
67
- * passed, or cleanup was forced. Waiting does not keep the process alive. */
82
+ /** Resolves once resource cleanup begins (because the app drained, the
83
+ * shutdown deadline expired, or cleanup was forced). Awaiting this promise
84
+ * does not keep the event loop alive. */
68
85
  export declare function cleanup(): Promise<void>;
69
- /** Resolves with the shutdown's result once cleanup has completed, after the
70
- * deadline too; rejects with a {@link ShutdownError} if cleanup failed.
71
- * Waiting keeps the process alive once the shutdown has begun. */
86
+ /** Resolves with the shutdown result once cleanup completes (even after the
87
+ * deadline), or rejects with {@link ShutdownError} if cleanup failed. Once
88
+ * shutdown has begun, awaiting this keeps the event loop alive. */
72
89
  export declare function completed(): Promise<ShutdownResult>;
73
- /** Begins cleanup without waiting for the app's holds or the Pub/Sub
74
- * handlers in flight. Work still running may find its resources closed. */
90
+ /** Starts resource cleanup immediately without waiting for application holds
91
+ * or in-flight Pub/Sub handlers. Work still running may encounter closed
92
+ * resources. */
75
93
  export declare function forceCleanup(): void;
76
- /** Begins the shutdown on SIGTERM or SIGINT, or on Windows when the daemon
77
- * asks the process to stop, and exits once it completes:
78
- * with `process.exitCode` (0 unless the app set it) if cleanup finished
79
- * within the shutdown deadline, else 1. A second SIGINT, a second Ctrl-C,
80
- * forces cleanup.
94
+ /**
95
+ * Installs signal listeners for `SIGTERM` and `SIGINT` (and daemon stop
96
+ * requests on Windows) to drive graceful shutdown and exit once cleanup
97
+ * completes. Exits with `process.exitCode` (0 unless set) if cleanup succeeds
98
+ * within the deadline, or 1 otherwise. A second `SIGINT` forces cleanup.
81
99
  *
82
- * An app that listens for the signal itself and holds nothing is waited for
83
- * until it raises the signal again, exits, or has closed everything it had
84
- * open. */
100
+ * If the application registers its own signal listener without using Encore's
101
+ * shutdown hooks, Encore waits until the application re-raises the signal,
102
+ * exits, or drains its event loop.
103
+ */
85
104
  export declare function watchShutdownSignals(): void;
86
- /** Runs `rt` until its shutdown completes, returning the exit code. The
87
- * runtime handles SIGTERM and SIGINT, and on Windows the console closing;
88
- * on them the shutdown begins here too, and cleanup waits for the app's
89
- * holds. */
105
+ /** Runs `r` until shutdown completes and returns the exit code. The native
106
+ * runtime handles `SIGTERM`, `SIGINT`, and Windows console close events,
107
+ * triggers JS shutdown here, and waits for application holds before cleanup. */
90
108
  export declare function runUntilShutdown(r: Runtime): Promise<number>;
91
- /** Has `sig` force cleanup when it comes again, as a second SIGINT does. */
109
+ /** Configures `sig` to force immediate cleanup when received a second time. */
92
110
  export declare function forceCleanupOnRepeat(sig: NodeJS.Signals): void;
93
111
  //# sourceMappingURL=shutdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shutdown.d.ts","sourceRoot":"","sources":["../../../internal/runtime/shutdown.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAE7C;;;;;;+DAM+D;AAC/D,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAEhF;;4BAE4B;AAC5B,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD,yEAAyE;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WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAK1D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAIjE;AAED;qDACqD;AACrD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAGzE;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAY5B;AAED,0CAA0C;AAC1C,wBAAgB,KAAK,IAAI,aAAa,CAErC;AAED;sDACsD;AACtD,wBAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvC;AAED;;yCAEyC;AACzC,wBAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvC;AAED;;mEAEmE;AACnE,wBAAgB,SAAS,IAAI,OAAO,CAAC,cAAc,CAAC,CASnD;AAED;;gBAEgB;AAChB,wBAAgB,YAAY,IAAI,IAAI,CAGnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C;AAED;;gFAEgF;AAChF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAI5D;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAE9D"}
@@ -1,31 +1,30 @@
1
- /** Encore's cleanup failed, or the shutdown was used before it began. */
1
+ /** Thrown when Encore's resource cleanup fails or a shutdown API is called invalidly. */
2
2
  export class ShutdownError extends Error {
3
3
  name = 'ShutdownError';
4
4
  }
5
- /** The signals that begin the shutdown. Under Node on Windows Ctrl-Break
6
- * too, which the daemon sends a process that doesn't listen for its stop
7
- * request; Bun dies of it, whatever it listens for. */
5
+ /** Signals that initiate graceful shutdown. On Windows under Node.js, includes
6
+ * `SIGBREAK` (sent by the daemon when a process does not handle stop requests);
7
+ * Bun terminates immediately on `SIGBREAK` regardless of listeners. */
8
8
  const SIGNALS = process.platform === 'win32' && !process.versions.bun
9
9
  ? ['SIGTERM', 'SIGINT', 'SIGBREAK']
10
10
  : ['SIGTERM', 'SIGINT'];
11
- /** How long after the first signal the same one again is a new one, not the
12
- * first delivered twice: a process group's runner may forward the signal its
13
- * members already received. */
11
+ /** Minimum interval after the first signal before the same signal is treated
12
+ * as a deliberate repeat rather than a duplicate forwarded by a process group. */
14
13
  const REPEAT_MS = 1000;
15
14
  let runtime;
16
- /** Whether the runtime runs the process ({@link runUntilShutdown}): it
17
- * handles the signals natively, and its caller exits. */
15
+ /** Whether the native runtime owns the event loop ({@link runUntilShutdown}),
16
+ * handling signals natively and letting its caller exit. */
18
17
  let hosted = false;
19
18
  const callbacks = new Set();
20
- /** The callbacks Encore registered itself, as its API framework's server
21
- * does: they don't say the app tells Encore of its shutdown. */
19
+ /** Callbacks registered internally by Encore (such as the API framework's
20
+ * server), which do not count as application-managed shutdown hooks. */
22
21
  const ownCallbacks = new WeakSet();
23
22
  let holds = 0;
24
23
  let begun = false;
25
24
  let markBegun;
26
25
  const begunAt = new Promise(resolve => (markBegun = resolve));
27
26
  let deadline = 0;
28
- /** Whether Encore was told the app has drained: holds count no longer. */
27
+ /** Whether the application has already been marked drained (new holds no longer delay cleanup). */
29
28
  let drained = false;
30
29
  let cleaningUp = false;
31
30
  const startAbort = new AbortController();
@@ -35,26 +34,24 @@ const startedAt = new Promise(resolve => (markStarted = resolve));
35
34
  let markCleanup;
36
35
  const cleanupAt = new Promise(resolve => (markCleanup = resolve));
37
36
  let completion;
38
- /** The signals that force cleanup when they come again: a second Ctrl-C, and
39
- * for a gateway program a second SIGTERM, which is how the supervisor stops
40
- * waiting for its drain. */
37
+ /** Signals that force immediate cleanup when received a second time (a second
38
+ * Ctrl-C, or for gateway processes a second `SIGTERM` from the supervisor). */
41
39
  const forcing = new Set(['SIGINT']);
42
- /** The signal that began the shutdown: Encore then exits once it completes. */
40
+ /** Signal that initiated shutdown; when set, Encore exits the process once cleanup finishes. */
43
41
  let signalled;
44
42
  let signalledAt = 0;
45
- /** Held for an app that handles the signal itself without telling Encore of
46
- * its shutdown, until it is done. */
43
+ /** Automatic hold kept while an application handles the shutdown signal itself. */
47
44
  let appHold;
48
- /** The signal the app raised again, to die of once Encore has cleaned up. */
45
+ /** Signal re-raised by the application after removing its own listener, re-sent after cleanup. */
49
46
  let reraised;
50
- /** Whether Encore waits for cleanup to complete, to exit. */
47
+ /** Whether Encore is currently waiting on cleanup to exit the process. */
51
48
  let exiting = false;
52
- /** Whether the process is on its way out, cleanup completed. */
49
+ /** Whether the process exit path has already started. */
53
50
  let finished = false;
54
- /** Aborts when shutdown begins: Encore takes no new Pub/Sub messages, and the
55
- * app should stop taking work too. */
51
+ /** Aborts as soon as shutdown begins: Encore stops accepting new Pub/Sub
52
+ * messages, and your application should stop accepting new work as well. */
56
53
  export const signal = startAbort.signal;
57
- /** Sets the runtime the shutdown runs on. */
54
+ /** Sets the native runtime instance used to coordinate shutdown. */
58
55
  export function setShutdownRuntime(rt) {
59
56
  runtime = rt;
60
57
  }
@@ -63,12 +60,15 @@ function rt() {
63
60
  throw new ShutdownError('the Encore runtime is not loaded');
64
61
  return runtime;
65
62
  }
66
- /** Holds the shutdown back: Encore cleans up once every hold is released, or
67
- * the shutdown deadline passes. A hold taken once the app has drained, or
68
- * cleanup has begun, comes released: cleanup does not wait for it. */
63
+ /**
64
+ * Delays Encore's resource cleanup until the returned hold is released or the
65
+ * shutdown deadline expires. If called after the application has already
66
+ * drained or cleanup has begun, returns an already-released hold and logs a
67
+ * warning.
68
+ */
69
69
  export function hold() {
70
70
  if (drained || cleaningUp) {
71
- console.warn('encore: a shutdown hold was taken after the app drained; cleanup does not wait for it');
71
+ console.warn('encore: shutdown hold acquired after the app drained; cleanup will not wait for it');
72
72
  const release = () => { };
73
73
  return { release, [Symbol.dispose]: release };
74
74
  }
@@ -83,32 +83,37 @@ export function hold() {
83
83
  };
84
84
  return { release, [Symbol.dispose]: release };
85
85
  }
86
- /** Holds the shutdown back until `work` settles. A rejection is logged. */
86
+ /** Delays resource cleanup until `work` settles. Any rejection is logged. */
87
87
  export function waitUntil(work) {
88
88
  const held = hold();
89
89
  Promise.resolve(work)
90
90
  .then(undefined, err => console.error('encore: shutdown work failed:', err))
91
91
  .finally(() => held.release());
92
92
  }
93
- /** Calls `callback` when shutdown begins, or at once if it has, holding
94
- * cleanup back until it settles. Disposing of the returned value
95
- * unregisters it. */
93
+ /**
94
+ * Registers `callback` to run when shutdown begins (or immediately if shutdown
95
+ * has already begun), delaying resource cleanup until it settles. Disposing
96
+ * the returned handle unregisters the callback.
97
+ */
96
98
  export function onShutdown(callback) {
97
99
  callbacks.add(callback);
98
100
  if (begun)
99
101
  run(callback);
100
102
  return { [Symbol.dispose]: () => void callbacks.delete(callback) };
101
103
  }
102
- /** Registers `callback` as {@link onShutdown} does, as Encore's own: it
103
- * doesn't stop Encore from waiting for an app that handles the signal itself. */
104
+ /** Registers an Encore-internal shutdown callback without disabling automatic
105
+ * detection of application-owned signal handlers. */
104
106
  export function onShutdownInternal(callback) {
105
107
  ownCallbacks.add(callback);
106
108
  return onShutdown(callback);
107
109
  }
108
- /** Begins the shutdown, once: Encore stops taking Pub/Sub messages,
109
- * {@link signal} aborts, and the {@link onShutdown} callbacks run. Encore
110
- * cleans up once every hold is released, or the shutdown deadline passes.
111
- * SIGTERM and SIGINT begin it, outside tests. */
110
+ /**
111
+ * Initiates graceful shutdown (idempotent): stops Pub/Sub intake, aborts
112
+ * {@link signal}, and invokes all registered {@link onShutdown} callbacks.
113
+ * Encore cleans up resources once every hold is released or the shutdown
114
+ * deadline expires. Outside tests, `SIGTERM` and `SIGINT` call this
115
+ * automatically.
116
+ */
112
117
  export function begin() {
113
118
  if (begun)
114
119
  return;
@@ -125,23 +130,24 @@ export function begin() {
125
130
  run(callback);
126
131
  settle();
127
132
  }
128
- /** The shutdown's phase now. */
133
+ /** Returns the current shutdown phase. */
129
134
  export function phase() {
130
135
  return (runtime?.shutdownPhase() ?? 'not-started');
131
136
  }
132
- /** Resolves once the shutdown has begun and Pub/Sub intake has stopped.
133
- * Waiting does not keep the process alive. */
137
+ /** Resolves once shutdown has begun and Pub/Sub intake has stopped. Awaiting
138
+ * this promise does not keep the event loop alive. */
134
139
  export function started() {
135
140
  return startedAt;
136
141
  }
137
- /** Resolves once cleanup begins: the app drained, the shutdown deadline
138
- * passed, or cleanup was forced. Waiting does not keep the process alive. */
142
+ /** Resolves once resource cleanup begins (because the app drained, the
143
+ * shutdown deadline expired, or cleanup was forced). Awaiting this promise
144
+ * does not keep the event loop alive. */
139
145
  export function cleanup() {
140
146
  return cleanupAt;
141
147
  }
142
- /** Resolves with the shutdown's result once cleanup has completed, after the
143
- * deadline too; rejects with a {@link ShutdownError} if cleanup failed.
144
- * Waiting keeps the process alive once the shutdown has begun. */
148
+ /** Resolves with the shutdown result once cleanup completes (even after the
149
+ * deadline), or rejects with {@link ShutdownError} if cleanup failed. Once
150
+ * shutdown has begun, awaiting this keeps the event loop alive. */
145
151
  export function completed() {
146
152
  return (completion ??= begunAt
147
153
  .then(() => rt().shutdownCompleted())
@@ -152,39 +158,40 @@ export function completed() {
152
158
  return result;
153
159
  }));
154
160
  }
155
- /** Begins cleanup without waiting for the app's holds or the Pub/Sub
156
- * handlers in flight. Work still running may find its resources closed. */
161
+ /** Starts resource cleanup immediately without waiting for application holds
162
+ * or in-flight Pub/Sub handlers. Work still running may encounter closed
163
+ * resources. */
157
164
  export function forceCleanup() {
158
165
  if (!begun)
159
166
  throw new ShutdownError('shutdown has not begun');
160
167
  rt().forceShutdownCleanup();
161
168
  }
162
- /** Begins the shutdown on SIGTERM or SIGINT, or on Windows when the daemon
163
- * asks the process to stop, and exits once it completes:
164
- * with `process.exitCode` (0 unless the app set it) if cleanup finished
165
- * within the shutdown deadline, else 1. A second SIGINT, a second Ctrl-C,
166
- * forces cleanup.
169
+ /**
170
+ * Installs signal listeners for `SIGTERM` and `SIGINT` (and daemon stop
171
+ * requests on Windows) to drive graceful shutdown and exit once cleanup
172
+ * completes. Exits with `process.exitCode` (0 unless set) if cleanup succeeds
173
+ * within the deadline, or 1 otherwise. A second `SIGINT` forces cleanup.
167
174
  *
168
- * An app that listens for the signal itself and holds nothing is waited for
169
- * until it raises the signal again, exits, or has closed everything it had
170
- * open. */
175
+ * If the application registers its own signal listener without using Encore's
176
+ * shutdown hooks, Encore waits until the application re-raises the signal,
177
+ * exits, or drains its event loop.
178
+ */
171
179
  export function watchShutdownSignals() {
172
180
  for (const s of SIGNALS)
173
181
  process.on(s, onSignal);
174
- // Windows has no SIGTERM: the daemon sets an event instead, which comes
175
- // as SIGTERM, to the app's own listeners too.
182
+ // Windows has no SIGTERM: the daemon signals a named event instead, which we
183
+ // surface as SIGTERM so application listeners see it too.
176
184
  rt().watchStopRequest(() => void process.emit('SIGTERM', 'SIGTERM'));
177
185
  }
178
- /** Runs `rt` until its shutdown completes, returning the exit code. The
179
- * runtime handles SIGTERM and SIGINT, and on Windows the console closing;
180
- * on them the shutdown begins here too, and cleanup waits for the app's
181
- * holds. */
186
+ /** Runs `r` until shutdown completes and returns the exit code. The native
187
+ * runtime handles `SIGTERM`, `SIGINT`, and Windows console close events,
188
+ * triggers JS shutdown here, and waits for application holds before cleanup. */
182
189
  export function runUntilShutdown(r) {
183
190
  runtime = r;
184
191
  hosted = true;
185
192
  return r.runForever(true, begin);
186
193
  }
187
- /** Has `sig` force cleanup when it comes again, as a second SIGINT does. */
194
+ /** Configures `sig` to force immediate cleanup when received a second time. */
188
195
  export function forceCleanupOnRepeat(sig) {
189
196
  forcing.add(sig);
190
197
  }
@@ -196,15 +203,15 @@ function onSignal(sig) {
196
203
  signalled = sig;
197
204
  signalledAt = Date.now();
198
205
  if (!appTellsShutdown() && process.listenerCount(sig) > 1) {
199
- // The app's own listeners run after this one, and may take their time.
206
+ // The app's own listeners run after this one and may take time to drain.
200
207
  appHold = hold();
201
- console.warn(`encore: the app handles ${sig} itself; Encore cleans up once it is done. ` +
202
- 'Register its shutdown with onShutdown() from @encore.dev/sdk/shutdown to say when.');
208
+ console.warn(`encore: detected custom ${sig} handler; Encore will clean up after it finishes. ` +
209
+ 'Use onShutdown() from @encore.dev/sdk/shutdown to coordinate shutdown explicitly.');
203
210
  }
204
211
  process.on('beforeExit', onIdle);
205
212
  begin();
206
213
  }
207
- /** Whether the app holds the shutdown back, or has callbacks of its own. */
214
+ /** Returns whether the application has any active holds or user-registered callbacks. */
208
215
  function appTellsShutdown() {
209
216
  if (holds > 0)
210
217
  return true;
@@ -218,8 +225,7 @@ function repeated(sig) {
218
225
  if (!signalled)
219
226
  return;
220
227
  if (appHold && sig === signalled && process.listenerCount(sig) === 1) {
221
- // The app raised the signal again, having removed its own listener. Only
222
- // the signal it handled counts: another may arrive while it still runs.
228
+ // The app removed its own listener and re-raised the original signal.
223
229
  reraised = sig;
224
230
  appHold.release();
225
231
  return;
@@ -228,12 +234,11 @@ function repeated(sig) {
228
234
  rt().forceShutdownCleanup();
229
235
  }
230
236
  }
231
- /** The event loop emptied. An app handling the signal itself is done; other
232
- * holds are still waited for, until the deadline, as work that holds nothing
233
- * open on the event loop may yet release them. */
237
+ /** Called when the event loop empties: releases any automatic app-signal hold
238
+ * while still honoring explicit holds until the deadline. */
234
239
  function onIdle() {
235
- // A turn later, as a signal the app raised as it closed its last handle is
236
- // read in that turn: it says how the app meant to end.
240
+ // Defer one turn so a signal re-raised while closing the last handle is
241
+ // observed first.
237
242
  setImmediate(() => {
238
243
  appHold?.release();
239
244
  if (!finished)
@@ -247,11 +252,11 @@ function settle() {
247
252
  function markDrained() {
248
253
  drained = true;
249
254
  rt().markApplicationDrained();
250
- // Now the app is done, the wait may hold the event loop open.
255
+ // Once the app is drained, keep the event loop alive while cleanup finishes.
251
256
  if (signalled)
252
257
  exitOnCompletion();
253
258
  }
254
- /** Exits once cleanup completes, holding the event loop open till then. */
259
+ /** Waits for cleanup to complete (keeping the event loop alive) and exits. */
255
260
  function exitOnCompletion() {
256
261
  if (exiting)
257
262
  return;
@@ -260,12 +265,11 @@ function exitOnCompletion() {
260
265
  }
261
266
  function onPhase(phase, result) {
262
267
  reached(phase);
263
- // Cleanup also completes once the shutdown deadline passes, the app done
264
- // or not; the exit code then says it was cut short.
268
+ // Cleanup also completes if the deadline expires before the app finishes.
265
269
  if (phase === 'completed' && signalled)
266
270
  exit(result ?? 'failed');
267
271
  }
268
- /** Settles what waits for `phase`, and for the phases before it. */
272
+ /** Resolves promises waiting on `phase` and any earlier phases. */
269
273
  function reached(phase) {
270
274
  if (phase === 'cleanup' || phase === 'completed') {
271
275
  cleaningUp = true;
@@ -274,13 +278,13 @@ function reached(phase) {
274
278
  }
275
279
  markStarted();
276
280
  }
277
- /** Exits with 1 if cleanup failed or timed out, else as the app meant to:
278
- * dying of the signal it raised again, or with its own exit code. */
281
+ /** Exits with 1 if cleanup failed or timed out; otherwise re-raises any signal
282
+ * the application re-raised, or exits with `process.exitCode`. */
279
283
  function exit(result) {
280
284
  if (finished)
281
285
  return;
282
286
  finished = true;
283
- // Completion may be heard of before the phases leading to it.
287
+ // Completion may arrive before intermediate phase callbacks.
284
288
  reached('completed');
285
289
  if (result !== 'success')
286
290
  process.exit(1);
@@ -292,8 +296,8 @@ function exit(result) {
292
296
  }
293
297
  process.exit();
294
298
  }
295
- /** An app that exits itself leaves no turn of the event loop to wait in:
296
- * cleanup finishes here, blocking, and a failure overrides its exit code. */
299
+ /** Handles synchronous process exit initiated by the application: finishes
300
+ * cleanup synchronously and overrides the exit code if cleanup fails. */
297
301
  function finishOnExit() {
298
302
  if (finished)
299
303
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../../../internal/runtime/shutdown.ts"],"names":[],"mappings":"AAgBA,yEAAyE;AACzE,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,IAAI,GAAG,eAAe,CAAC;CACjC;AAsBD;;uDAEuD;AACvD,MAAM,OAAO,GACX,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,OAAO,C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