Start a background process
Fetch logs and stop
kill():
BackgroundCommand also supports:
server.get_logs()to fetchstdout,stderr, interleavedoutput, and optionalexit_code.server.wait()to block until exit. If there is no live WebSocket attached, it polls the process list and then fetches logs.server.disconnect()to close a live stream without killing the process.- Iteration over
(stdout_chunk, stderr_chunk, None)tuples; this polls logs for new output.
Live background output
Pass callbacks withbackground=True when you want the process to keep running
and stream output immediately:
Use with preview URLs
0.0.0.0 inside the sandbox so preview URLs can reach
the process.