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
Copy file name to clipboardExpand all lines: docs/sandbox/auto-resume.mdx
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@ title: "AutoResume"
3
3
sidebarTitle: AutoResume
4
4
---
5
5
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.
7
8
8
9
## Configure lifecycle on create
9
10
@@ -49,3 +50,11 @@ sandbox = Sandbox.create(
49
50
-`onTimeout: "pause"` with `resumeOn: "any"` gives auto-pause with auto-resume.
50
51
51
52
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