Skip to content

get_subprocess

faststream.cli.supervisors.utils.get_subprocess #

get_subprocess(target, args)

Spawn a subprocess.

Source code in faststream/cli/supervisors/utils.py
def get_subprocess(target: "DecoratedCallableNone", args: Any) -> "SpawnProcess":
    """Spawn a subprocess."""
    stdin_fileno: Optional[int]
    try:
        stdin_fileno = sys.stdin.fileno()
    except OSError:
        stdin_fileno = None

    return spawn.Process(
        target=subprocess_started,
        args=args,
        kwargs={"t": target, "stdin_fileno": stdin_fileno},
    )