MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / send

Function send

flow-debugger/debugger-ui/src/websocket.js:52–70  ·  view source on GitHub ↗
(seq_id, msg, callback=undefined)

Source from the content-addressed store, hash-verified

50 };
51
52 const send = (seq_id, msg, callback=undefined) => {
53 msg.ty = 'request';
54 if (seq_id >= 0)
55 msg.seq_id = seq_id;
56 else {
57 msg.seq_id = seq;
58 setSeq(seq + 1);
59 }
60 let tmp = registry;
61 if (!(msg.seq_id in tmp)) {
62 tmp[msg.seq_id] = []
63 }
64 if (callback) {
65 tmp[msg.seq_id].push(callback)
66 }
67 setRegistry(tmp);
68 ws.current && ws.current.send(JSON.stringify(msg));
69 return msg.seq_id;
70 };
71
72 useEffect(() => {
73 return () => {

Callers 1

AppHeader.jsFile · 0.70

Calls 2

pushMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected