You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`ScaleToZeroGuard` is a disposable object that keeps the application awake until the guard is released. Use it for a scoped function or block of background work. `ScaleToZeroGuard` can be created multiple times during a single request and is safe to nest. Pass an `AbortSignal`, usually from `AbortSignal.timeout(ms)`, as a safety bound if release is not reached. The signal releases the guard only; it does not cancel the guarded work.
22
+
`KeepAwakeGuard` is a disposable object that keeps the application awake until the guard is released. Use it for a scoped function or block of background work. `KeepAwakeGuard` can be created multiple times during a single request and is safe to nest. Pass an `AbortSignal`, usually from `AbortSignal.timeout(ms)`, as a safety bound if release is not reached. The signal releases the guard only; it does not cancel the guarded work.
23
23
24
24
Read more about disposables and the `using` keyword in the [MDN resource management guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Resource_management).
If `using` is not available, call `.release()` manually. Always release the guard in a `finally` block so it is released even if the guarded code throws.
0 commit comments