schedr.runner.main

The runner’s entry point: the handshake with the agent, then the requested mode.

schedr.runner.main.FD_ENV = 'SCHEDR_AGENT_FD'

The environment variable with the descriptor of the socket the agent handed over.

schedr.runner.main.MODES = ('parse', 'task', 'fork_server', 'watchers')

The modes the runner can be started in.

schedr.runner.main.EXIT_ERROR = 1

Exit code for a failure talking to the agent.

schedr.runner.main.EXIT_USAGE = 2

unknown mode, no agent socket, refused handshake.

Type:

Exit code for a wrong start

schedr.runner.main.main(argv, environ, *, open_channel=<function from_fd>, stderr=None)

Runs the runner: parse, task, fork_server or watchers.

Parameters:
  • argv (list[str]) – The arguments after -m schedr.runner.

  • environ (Mapping[str, str]) – The environment (for SCHEDR_AGENT_FD).

  • open_channel (Callable[[int], Channel]) – Opens the channel on the inherited descriptor (replaced in tests).

  • stderr (TextIO | None) – Where messages go; sys.stderr by default.

Returns:

0 on success, 1 on a failed task or a failure talking to the agent, 2 on a wrong start.

Return type:

The exit code