async def _extract_port_from_spawned_companion(stream: asyncio.StreamReader) -> int: # The first line of stdout should contain launch info, # otherwise something bad has happened line = await stream.readline() logging.debug(f"Read line from companion: {line}") update = parse_json_line(line) logging.debug(f"Got update from companion: {update}") return int(update["grpc_port"])
async def _read_notifier_output(self, stream: asyncio.StreamReader) -> None: while True: line = await stream.readline() if line is None: return update = parse_json_line(line) if update["report_initial_state"]: return