Skip to main content

run_python

Function run_python 

Source
pub async fn run_python(
    process: &ProcessSpec,
    task: impl Into<PythonTask>,
    limits: Limits,
    stop: Stops,
    forks: Option<&ForkServers>,
    hold: &mut Option<GroupHold>,
    spawned: impl FnOnce(i32, bool),
) -> Result<Ran, LaunchError>
Expand description

Runs a Python task: starts the runner (forked by forks when there are any and they can, unless the task asks for a fresh process; only by the bare server with preload off), sends the request, and waits for its result while supervising the process; spawned gets the runner’s process ID, and whether it was forked, as soon as it runs. A forked process’s GroupHold goes to hold, on every path (the caller drops it after its watchdog).

§Errors

LaunchError if the runner can’t be started or supervised; a runner that dies or sends nothing still gives a Ran (without a result).