IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

ProcessStatus

struct ProcessStatus

Represents the termination status of a process.

This struct is returned by poll() and wait().

Fields

  • exit_code (Optional[Int]): The exit code if the process terminated normally.
  • term_signal (Optional[Int]): The signal number that terminated the process.

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable

Methods

__init__

__init__(out self, exit_code: Optional[Int] = None, term_signal: Optional[Int] = None)

Initializes a new ProcessStatus.

Args:

  • exit_code (Optional[Int]): The exit code if the process terminated normally.
  • term_signal (Optional[Int]): The signal number that terminated the process.

running

static running() -> Self

Creates a status for a running process.

Returns:

Self: A ProcessStatus for a running process.

has_exited

has_exited(self) -> Bool

Checks if the process has terminated.

Returns:

Bool: True if the process has terminated, either normally or by a signal.