MCPcopy Index your code
hub / github.com/ermak-dev/cloudpub / monitor

Function monitor

client/cloudpub.py:16–27  ·  view source on GitHub ↗
(stream_in, stream_out, extract_url=False)

Source from the content-addressed store, hash-verified

14 extracted_url = [None]
15
16 def monitor(stream_in, stream_out, extract_url=False):
17 def reader():
18 with stream_in:
19 for line in stream_in:
20 stream_out.write(line)
21
22 # Check for the publication message and extract URL
23 if extract_url:
24 match = re.search(r'.+ -> (.+)', line)
25 if match:
26 extracted_url[0] = match.group(1)
27 return reader
28
29 threading.Thread(target=monitor(process.stdout, sys.stdout, True), daemon=True).start()
30 threading.Thread(target=monitor(process.stderr, sys.stderr), daemon=True).start()

Callers 1

run_cloudpubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected