Flashbox

Background processes

Start a process that outlives the call, read its output later, and stop it when you are done. Starting one counts as a command; while it runs, checkpoints include memory, so it survives rollback, fork and hibernation.

POST /v1/sandboxes/:id/processes          {"command": "python3 -u worker.py", "cwd": "/workspace"}
GET  /v1/sandboxes/:id/processes
GET  /v1/sandboxes/:id/processes/p1/logs?offset=0&waitMs=5000
POST /v1/sandboxes/:id/processes/p1/kill  {"signal": "SIGTERM"}

Logs are read from an offset; waitMs waits up to 20 seconds for new output. CPU a process uses between your commands is billed as background CPU.

Startup time matters under emulation: Python's built-in http.server takes about 7 seconds of CPU to start in a sandbox. Small tools (nc, a shell loop) start at once.