Execution¶
The Execution class represents an asynchronous command execution in progress.
Execution management for async commands.
- class runloop_api_client.sdk.execution.Execution(client, devbox_id, execution, streaming_group=None)[source]¶
Manages an asynchronous command execution on a devbox.
Provides methods to poll execution state, wait for completion, and terminate the running process. Created by
devbox.cmd.exec_async().Example
>>> execution = devbox.cmd.exec_async(command="python train.py") >>> state = execution.get_state() >>> if state.status == "running": ... execution.kill() >>> result = execution.result() # Wait for completion >>> print(result.stdout())
- property execution_id: str¶
Return the execution identifier.
- Returns:
Unique execution ID
- Return type:
- property devbox_id: str¶
Return the devbox identifier.
- Returns:
Devbox ID where the command is running
- Return type:
- result(**options)[source]¶
Wait for completion and return an
ExecutionResult.- Parameters:
options (
Unpack[LongRequestOptions]) – Optional long-running request configuration- Returns:
Wrapper with exit status and output helpers
- Return type:
- get_state(**options)[source]¶
Fetch the latest execution state.
- Parameters:
options (
Unpack[BaseRequestOptions]) – Optional request configuration- Returns:
Current execution metadata
- Return type:
- kill(**options)[source]¶
Request termination of the running execution.
- Parameters:
options (
Unpack[LongRequestOptions]) – Optional long-running request configuration- Return type: