MCPcopy Create free account
hub / github.com/1jehuang/jcode / send_message_async

Function send_message_async

scripts/test_soft_interrupt.py:59–69  ·  view source on GitHub ↗

Send message in a thread.

(msg, session_id, result_queue)

Source from the content-addressed store, hash-verified

57 sock.close()
58
59def send_message_async(msg, session_id, result_queue):
60 """Send message in a thread."""
61 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
62 try:
63 sock.connect(SOCKET_PATH)
64 ok, output = send_cmd_blocking(sock, f"message:{msg}", session_id, timeout=180)
65 result_queue.put((ok, output))
66 except Exception as e:
67 result_queue.put((False, str(e)))
68 finally:
69 sock.close()
70
71def create_test_session(cwd="/tmp"):
72 """Create a headless test session."""

Callers

nothing calls this directly

Calls 3

send_cmd_blockingFunction · 0.85
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected