python/ray/_private/test_utils.py
def run_string_as_driver_nonblocking(driver_script, env: Dict = None):
    """Start a driver as a separate process and return immediately.

    Args:
        driver_script: A string to run as a Python script.

    Returns:
        A handle to the driver process.
    """
    script = "; ".join(
        [
            "import sys",
            "script = sys.stdin.read()",
            "sys.stdin.close()",
            "del sys",
            'exec("del script\\n" + script)',
        ]
    )
    proc = subprocess.Popen(
        [sys.executable, "-c", script],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        env=env,
    )
    proc.stdin.write(driver_script.encode("ascii"))
    proc.stdin.close()
    return proc
Start a driver as a separate process and return immediately.

    Args:
        driver_script: A string to run as a Python script.

    Returns:
        A handle to the driver process.
    
Start a driver as a separate process and return immediately.
Start a driver as a separate process and return immediately .
def run_string_as_driver_nonblocking(driver_script, env: Dict = None):
    script = "; ".join(
        [
            "import sys",
            "script = sys.stdin.read()",
            "sys.stdin.close()",
            "del sys",
            'exec("del script\\n" + script)',
        ]
    )
    proc = subprocess.Popen(
        [sys.executable, "-c", script],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        env=env,
    )
    proc.stdin.write(driver_script.encode("ascii"))
    proc.stdin.close()
    return proc
def run_string_as_driver_nonblocking ( driver_script , env : Dict = None ) : script = "; " . join ( [ "import sys" , "script = sys.stdin.read()" , "sys.stdin.close()" , "del sys" , 'exec("del script\\n" + script)' , ] ) proc = subprocess . Popen ( [ sys . executable , "-c" , script ] , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE , env = env , ) proc . stdin . write ( driver_script . encode ( "ascii" ) ) proc . stdin . close ( ) return proc
Start a driver as a separate process and return immediately.
Start a driver as a separate process and return immediately .
"""Start a driver as a separate process and return immediately.

    Args:
        driver_script: A string to run as a Python script.

    Returns:
        A handle to the driver process.
    """
A handle to the driver process.
A handle to the driver process .
driver_script
A string to run as a Python script.
A string to run as a Python script .
env
Dict