MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / constructor

Method constructor

e2e/desktop-packaged/linux-vm/repro.mjs:78–88  ·  view source on GitHub ↗
(ws)

Source from the content-addressed store, hash-verified

76 #id = 1;
77 #pending = new Map();
78 constructor(ws) {
79 this.#ws = ws;
80 ws.addEventListener("message", (e) => {
81 const m = JSON.parse(e.data);
82 if (!m.id) return;
83 const p = this.#pending.get(m.id);
84 if (!p) return;
85 this.#pending.delete(m.id);
86 m.error ? p.reject(new Error(m.error.message)) : p.resolve(m.result);
87 });
88 }
89 static connect(url) {
90 return new Promise((resolve, reject) => {
91 const ws = new WebSocket(url);

Callers

nothing calls this directly

Calls 3

resolveMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected