MCPcopy Create free account
hub / github.com/microsoft/debugpy / _invoke

Function _invoke

tests/watchdog/__init__.py:81–103  ·  view source on GitHub ↗
(command, *args)

Source from the content-addressed store, hash-verified

79
80
81def _invoke(command, *args):
82 def timeout():
83 time.sleep(WATCHDOG_TIMEOUT)
84 if timeout.occurred is None:
85 reason = _dump_worker_log(command, "timed out")
86 timeout.occurred = reason
87
88 timeout.occurred = None
89 timeout_thread = threading.Thread(target=timeout)
90 timeout_thread.daemon = True
91 timeout_thread.start()
92 try:
93 try:
94 _stream.write_json([command] + list(args))
95 response = _stream.read_json()
96 assert response == ["ok"], f"{_name} {response!r}"
97 finally:
98 timeout.occurred = False
99 except Exception:
100 _dump_worker_log(command, "failed", sys.exc_info())
101 raise
102 else:
103 assert not timeout.occurred, str(timeout.occurred)
104
105
106def stop():

Callers 3

stopFunction · 0.85
register_spawnFunction · 0.85
unregister_spawnFunction · 0.85

Calls 4

_dump_worker_logFunction · 0.85
startMethod · 0.45
write_jsonMethod · 0.45
read_jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…