MCPcopy Create free account
hub / github.com/CreditTone/hooker / tee_reader

Function tee_reader

hooker.py:1114–1124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1112 pipe_w = None
1113 stop_event = threading.Event()
1114 def tee_reader():
1115 while not stop_event.is_set():
1116 try:
1117 data = os.read(pipe_r, 8192)
1118 if not data:
1119 break
1120 os.write(saved_fd, data)
1121 log_fh.write(data.decode('utf-8', errors='replace'))
1122 log_fh.flush()
1123 except Exception:
1124 break
1125 tee_thread = threading.Thread(target=tee_reader, daemon=True)
1126 tee_thread.start()
1127 if is_spawn:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected