def METHOD_NAME(path: Path) -> Generator[int, None, None]:
    """Run an example app from a python file.
    The first ``Litestar`` instance found in the file will be used as target to run.
    """
    while AVAILABLE_PORTS:
        port = AVAILABLE_PORTS.pop(0)
        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
            if sock.connect_ex(("127.0.0.1", port)) != 0:
                break
    else:
        raise StartupError("Could not find an open port")
    app = _load_app_from_path(path)
    def run() -> None:
        with redirect_stderr(Path(os.devnull).open()):
            uvicorn.run(app, port=port, access_log=False)
    proc = multiprocessing.Process(target=run)
    proc.start()
    try:
        for _ in range(100):
            try:
                httpx.get(f"http://127.0.0.1:{port}", timeout=0.1)
                break
            except httpx.TransportError:
                time.sleep(0.1)
        else:
            raise StartupError(f"App {path} failed to come online")
        yield port
    finally:
        proc.kill()
        AVAILABLE_PORTS.append(port)