MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / send_message

Function send_message

python/examples/blocking/ws.py:7–14  ·  view source on GitHub ↗
(ws, stop_event)

Source from the content-addressed store, hash-verified

5
6
7def send_message(ws, stop_event):
8 for i in range(20):
9 if stop_event.is_set():
10 break
11 print(f"Sending: Message {i + 1}")
12 ws.send(Message.from_text(f"Message {i + 1}"))
13 time.sleep(0.1)
14 ws.send(Message.from_text("CLOSE"))
15
16
17def receive_message(ws, stop_event):

Callers

nothing calls this directly

Calls 2

from_textMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected