def METHOD_NAME(jlink):
    try:
        while jlink.connected():
            terminal_bytes = jlink.rtt_read(0, 1024)
            if terminal_bytes:
                parse_lines("".join(map(chr, terminal_bytes)))
            time.sleep(0.01)
    except Exception:
        print("IO read thread exception, exiting...")
        thread.interrupt_main()
        raise