Skip to content

Commit c1e446d

Browse files
update with use cases
1 parent e080cc1 commit c1e446d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

docs/sandbox/auto-resume.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: "AutoResume"
33
sidebarTitle: AutoResume
44
---
55

6-
`AutoResume` is configured through the `lifecycle` object when creating a sandbox.
6+
`AutoResume` builds on [sandbox persistence](/docs/sandbox/persistence): a sandbox pauses at timeout and is then resumed from that paused state.
7+
Configure `AutoResume` through the `lifecycle` object when creating a sandbox.
78

89
## Configure lifecycle on create
910

@@ -49,3 +50,11 @@ sandbox = Sandbox.create(
4950
- `onTimeout: "pause"` with `resumeOn: "any"` gives auto-pause with auto-resume.
5051

5152
If you use `resumeOn: "off"`, resume explicitly with [`Sandbox.connect()`](/docs/sandbox/connect).
53+
54+
## Use cases
55+
56+
1. Running a web server
57+
Configure `lifecycle` with `onTimeout: "pause"` and `resumeOn: "any"` so the sandbox can resume when traffic hits your service again.
58+
59+
2. Code execution workloads
60+
For agent/tool execution, use `resumeOn: "any"` so the sandbox can start back up automatically when the next command or code execution request arrives.

0 commit comments

Comments
 (0)