AsyncSandboxProcess¶
- class baseten.sandbox.AsyncSandboxProcess¶
Bases:
objectAsync form of
SandboxProcess.- Parameters:
context (AsyncSandboxContext)
- async close_stdin(*, identifier)¶
Close a process’s standard input. As
SandboxProcess.close_stdin().- Parameters:
identifier (str)
- Return type:
None
- async exec(*, command, name=None, working_dir=None, env=None, timeout=None, wait_for_completion=None, keep_alive=None, max_restarts=None, restart_on_failure=None, stdin=None, wait_for_ports=None)¶
Start a command. As
SandboxProcess.exec().- Parameters:
- Return type:
- async exec_stream(*, command, name=None, working_dir=None, env=None, timeout=None, keep_alive=None, max_restarts=None, restart_on_failure=None, stdin=None, wait_for_ports=None)¶
Run a command, streaming its output. As
SandboxProcess.exec_stream().- Parameters:
- Return type:
AsyncSandboxStream[SandboxProcessExecEventOutput | SandboxProcessExecEventExit]
- async get(*, identifier)¶
Get a process. As
SandboxProcess.get().- Parameters:
identifier (str)
- Return type:
- async kill(*, identifier)¶
Request that a process exit forcefully. As
SandboxProcess.kill().- Parameters:
identifier (str)
- Return type:
None
- async list()¶
List the sandbox’s processes. As
SandboxProcess.list().- Return type:
- async logs(*, identifier)¶
Get a process’s output so far. As
SandboxProcess.logs().- Parameters:
identifier (str)
- Return type:
- async stop(*, identifier)¶
Request that a process exit gracefully. As
SandboxProcess.stop().- Parameters:
identifier (str)
- Return type:
None
- async stream_logs(*, identifier)¶
Stream a process’s output. As
SandboxProcess.stream_logs().- Parameters:
identifier (str)
- Return type:
- async wait(*, identifier, timeout=datetime.timedelta(seconds=60), poll_interval=datetime.timedelta(seconds=1))¶
Wait for a process to finish. As
SandboxProcess.wait().- Parameters:
- Return type:
- async write_stdin(*, identifier, data)¶
Write to a process’s standard input. As
SandboxProcess.write_stdin().