Skip to content

docs(compute): add KeepAwakeGuard documentation#7960

Open
prisma-gremlin[bot] wants to merge 7 commits into
mainfrom
docs/compute-keep-awake-guard
Open

docs(compute): add KeepAwakeGuard documentation#7960
prisma-gremlin[bot] wants to merge 7 commits into
mainfrom
docs/compute-keep-awake-guard

Conversation

@prisma-gremlin

@prisma-gremlin prisma-gremlin Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What changed

Adds a new documentation page for the KeepAwakeGuard feature from @prisma/compute at /compute/keep-awake-guard.

Key details documented

  • KeepAwakeGuard is the current name, renamed from ScaleToZeroGuard in @prisma/compute@0.1.0-dev.4.1. The old name is documented as a deprecated alias.
  • The guard keeps a compute instance awake, preventing it from scaling to zero — useful for long-running work, background tasks, and WebSocket connections.
  • The signal option is a fallback for extreme cases where the platform cannot honor the keep-awake guarantee. It is explicitly not intended as the cancellation signal for underlying work.
  • The API design follows waitUntil-style patterns from Cloudflare Workers and Service Worker APIs for familiarity.
  • Includes usage examples with release(), waitUntil, and the signal fallback.

Files changed

  • apps/docs/content/docs/compute/keep-awake-guard.mdx — new documentation page
  • apps/docs/content/docs/compute/meta.json — added keep-awake-guard to the Features section of the sidebar

Summary by CodeRabbit

  • Documentation
    • Added a new “Keeping instances awake” guide for Prisma Compute, explaining scale-to-zero by default and how to keep instances running for longer-lived work (e.g., background promises and WebSocket-style lifetimes). Covers waitUntil, KeepAwakeGuard, including release() and the signal fallback option, with examples and links to related documentation.

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jun 19, 2026 12:19pm
docs Ready Ready Preview, Comment Jun 19, 2026 12:19pm
eclipse Ready Ready Preview, Comment Jun 19, 2026 12:19pm
site Ready Ready Preview, Comment Jun 19, 2026 12:19pm

Request Review

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🍈 Lychee Link Check Report

9 links: ✅ 3 OK | 🚫 0 errors | 🔀 0 redirects | 👻 6 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 3
🔀 Redirected 0
👻 Excluded 6
🚫 Errors 0
⛔ Unsupported 0
⏳ Timeouts 0
❓ Unknown 0

@argos-ci

argos-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 1 changed Jun 19, 2026, 12:24 PM

- Rename the page to "Long-running servers" (searchable by intent) and lead with
  the use case; KeepAwakeGuard stays documented as the API
- Slug/url -> /compute/long-running-servers; reposition in the nav under Features
  right after Deployments
- Make "Next steps" start with "Get started with Prisma Compute"
- Remove em dashes, tighten for coherence (add a "When to use it" section)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

A new MDX documentation page, keeping-instances-awake.mdx, is added to the Prisma Compute docs section. It covers the waitUntil and KeepAwakeGuard APIs for managing instance lifetimes, usage patterns including using disposal and try/finally control, AbortSignal fallback semantics, an API reference table, and next-step links. The page is registered in meta.json.

Changes

Instance Keep-Awake Documentation

Layer / File(s) Summary
Navigation registration and page introduction
apps/docs/content/docs/compute/meta.json, apps/docs/content/docs/compute/keeping-instances-awake.mdx
Adds keeping-instances-awake to the Compute nav pages list; page frontmatter sets title, description, canonical URL, and SEO fields; introductory sections explain scale-to-zero behavior, example workload types requiring keep-awake lifetimes, and when neither API is needed.
waitUntil API documentation
apps/docs/content/docs/compute/keeping-instances-awake.mdx
Documents waitUntil as the direct API for extending instance lifetime through background promises initiated during a request; includes a practical request handler example, explanation of the optional caller-owned signal fallback that does not cancel the work, and service-worker-style semantics.
KeepAwakeGuard patterns and signal fallback
apps/docs/content/docs/compute/keeping-instances-awake.mdx
Documents KeepAwakeGuard for manually controlled block-scoped lifetimes; shows using-based automatic disposal and equivalent try/finally patterns with explicit release() calls; explains the optional signal option as an emergency fallback mechanism (not primary control) with timeout examples and guidance on manual release semantics.
API reference and next steps
apps/docs/content/docs/compute/keeping-instances-awake.mdx
Provides TypeScript signatures for waitUntil and KeepAwakeGuard constructors; includes a member table documenting release() method and Disposable support for using statements; adds next-steps links to related Compute docs (getting started, pricing, deployments, environment variables, configuration, known limitations).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding documentation for KeepAwakeGuard. It's concise, specific, and directly reflects the main deliverable of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

"Long-running servers" implied an always-on server. The feature actually keeps
an instance awake (prevents scale-to-zero) while work outlives a request, so
title/slug/url -> "Keeping instances awake" / /compute/keeping-instances-awake.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…test

The 0.1.0-dev.4.1 version is not user-facing. Reword the rename note to install
@prisma/compute@latest and migrate imports to KeepAwakeGuard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/docs/compute/keeping-instances-awake.mdx`:
- Around line 11-15: The documentation introduces KeepAwakeGuard but does not
document ScaleToZeroGuard as its deprecated predecessor. Add a compatibility
note or migration section in the keeping-instances-awake.mdx file that clarifies
that ScaleToZeroGuard has been deprecated and replaced with KeepAwakeGuard,
helping users on older versions of `@prisma/compute` understand the naming change.
This note should be included both where KeepAwakeGuard is first introduced in
the primitives list and in any other relevant sections (around lines 128-145)
where KeepAwakeGuard usage is discussed or demonstrated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bf1fdb0b-47d2-4508-adbc-61fe4c70f0cc

📥 Commits

Reviewing files that changed from the base of the PR and between 283569d and 57b8d19.

📒 Files selected for processing (1)
  • apps/docs/content/docs/compute/keeping-instances-awake.mdx

Comment thread apps/docs/content/docs/compute/keeping-instances-awake.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants