AsyncSandboxProcess

class baseten.sandbox.AsyncSandboxProcess

Bases: object

Async 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:

SandboxProcessInfo

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:

SandboxProcessInfo

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:

list[SandboxProcessInfo]

async logs(*, identifier)

Get a process’s output so far. As SandboxProcess.logs().

Parameters:

identifier (str)

Return type:

SandboxProcessLogs

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:

AsyncSandboxStream[SandboxProcessLogLine]

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:

SandboxProcessInfo

async write_stdin(*, identifier, data)

Write to a process’s standard input. As SandboxProcess.write_stdin().

Parameters:
Return type:

None