Skip to content

Commit 8160896

Browse files
committed
chore(documentation): correct exec advice
1 parent bceb953 commit 8160896

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llms.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
- **Prefer `AsyncRunloopSDK` over `RunloopSDK`** for better concurrency and performance; all SDK methods have async equivalents
2424
- Use `async with await runloop.devbox.create()` for automatic cleanup via context manager
2525
- For resources without SDK coverage (e.g., secrets, benchmarks), use `runloop.api.*` as a fallback
26-
- Execute commands with `await devbox.cmd.exec('command')`, not raw API calls
27-
- Always call `await devbox.shutdown()` to clean up resources (or use context manager)
28-
- Streaming callbacks (`stdout`, `stderr`) must be synchronous functions even with async SDK
26+
- Use `await devbox.cmd.exec('command')` for most commands—blocks until completion, returns `ExecutionResult` with stdout/stderr
27+
- Use `await devbox.cmd.exec_async('command')` for long-running or background processes (servers, watchers)—returns immediately with `Execution` handle to check status, get result, or kill
28+
- Both `exec` and `exec_async` support streaming callbacks (`stdout`, `stderr`, `output`) for real-time output
29+
- Call `await devbox.shutdown()` to clean up resources that are no longer in use.
30+
- Streaming callbacks (`stdout`, `stderr`, `output`) must be synchronous functions even with async SDK
2931
- In example files, focus on the `recipe` function body for SDK usage patterns; ignore test harness files (`_harness.py`, `registry.py`, `example_types.py`)
3032

3133
## Async vs Sync

0 commit comments

Comments
 (0)