container_process

ContainerProcess

class ContainerProcess(typing.Generic)

Represents a running process in a container.

Container processes communicate via direct communication with the Modal worker where the container is running.

__init__(self, process_id, task_id, client, command_router_client,
    stdout=StreamType.PIPE, stderr=StreamType.PIPE, exec_deadline=None,
    text=True, by_line=False)

stdout

stdout(self)

StreamReader for the container process's stdout stream.

stderr

stderr(self)

StreamReader for the container process's stderr stream.

stdin

stdin(self)

StreamWriter for the container process's stdin stream.

returncode

returncode(self)

poll

poll(self)

Check if the container process has finished running.

Returns None if the process is still running, else returns the exit code.

wait

wait(self)

Wait for the container process to finish running. Returns the exit code.