nodus.process
View MarkdownProcesses and files inside a running Job, Sandbox or Workspace (resources.md §3.6).
stdout, stderr and stdin use the long-poll protocol (output, stdin, signals), which needs no WebSocket
and works through every proxy; a Process’s output is retained, so a reader that reconnects resumes from its offset.
p.attach() opens the interactive remotecommand v5 WebSocket session instead, for terminals.
Attach
Section titled “Attach”class Attach(ws: Any) -> NoneFrames of a remotecommand v5 session: iterate for (stream, bytes); write, resize, close_stdin.
Attach.close_stdin
Section titled “Attach.close_stdin”close_stdin() -> NoneAttach.exit_code
Section titled “Attach.exit_code”Type: int | None
Set once the session reports the process’s exit status.
Attach.resize
Section titled “Attach.resize”resize(rows: int, cols: int) -> NoneAttach.write
Section titled “Attach.write”write(data: bytes | str) -> Noneclass File(files: _Files, path: str, mode: str) -> NoneA file opened with sb.open(path, mode): reads come from one download, writes upload on close().
File.close
Section titled “File.close”close() -> NoneFile.read
Section titled “File.read”read(n: int = 1) -> str | bytesFile.write
Section titled “File.write”write(data: str | bytes) -> intclass Files(client: Client, kind: str, name: str, project: str | None = None) -> NoneThe files subresource of a Job, Sandbox or Workspace.
Files.list
Section titled “Files.list”list(path: str = '/') -> list[Obj]Files.open
Section titled “Files.open”open(path: str, mode: str = 'r') -> _FileFiles.read
Section titled “Files.read”read(path: str) -> bytesFiles.remove
Section titled “Files.remove”remove(path: str) -> NoneFiles.write
Section titled “Files.write”write(path: str, data: bytes | str, expected_sha256: str | None = None) -> NoneProcess
Section titled “Process”class Process(client: Client, obj: Obj) -> NoneOne command executing in a running attempt: stdout, stderr, stdin, wait(), returncode.
Process.attach
Section titled “Process.attach”attach(stdin: bool = True, tty: bool = False) -> AsyncIterator[_Attach]An interactive session over the remotecommand v5 WebSocket (one stdin writer; many readers).
Process.cancel
Section titled “Process.cancel”cancel() -> NoneProcess.name
Section titled “Process.name”Type: str
Process.resize
Section titled “Process.resize”resize(rows: int, cols: int) -> NoneProcess.returncode
Section titled “Process.returncode”Type: int | None
The exit code once the process has finished, else None.
Process.signal
Section titled “Process.signal”signal(sig: str) -> NoneSend SIGINT, SIGTERM, SIGKILL, SIGHUP, SIGQUIT, SIGUSR1 or SIGUSR2.
Process.start
Section titled “Process.start”start(client: Client, kind: str, parent: str, command: list[str], *, tty: bool = False, stdin: bool = False, env: dict[str, str] | None = None, workdir: str | None = None, timeout: str | None = None, project: str | None = None, **params: Any) -> _ProcessProcess.stderr
Section titled “Process.stderr”Type: _StreamReader
Process.stdin
Section titled “Process.stdin”Type: _StdinWriter
Process.stdout
Section titled “Process.stdout”Type: _StreamReader
Process.wait
Section titled “Process.wait”wait(timeout: float | None = None) -> intBlock until the process exits and return its exit code; TimeoutError after timeout seconds.
Process.write
Section titled “Process.write”write(data: bytes | str) -> NoneStdinWriter
Section titled “StdinWriter”class StdinWriter(proc: _Process) -> NoneStdinWriter.drain
Section titled “StdinWriter.drain”drain() -> NoneWrites are sent as they are made, so there is nothing buffered to flush.
StdinWriter.write
Section titled “StdinWriter.write”write(data: bytes | str) -> NoneStdinWriter.write_eof
Section titled “StdinWriter.write_eof”write_eof() -> NoneStreamReader
Section titled “StreamReader”class StreamReader(proc: _Process, stream: str) -> Nonestdout or stderr of a Process: read() returns everything; iterating yields text as it arrives.
StreamReader.read
Section titled “StreamReader.read”read() -> strStreamReader.read_bytes
Section titled “StreamReader.read_bytes”read_bytes() -> bytes