MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / addPort

Method addPort

src/controller/main.controller.js:57–71  ·  view source on GitHub ↗
(port, eventCache)

Source from the content-addressed store, hash-verified

55
56class ControllerTransaction {
57 async addPort(port, eventCache) {
58 const sender = parseViewName(port.name);
59 const subContr = await controllerPool.get(sender.id);
60 if (subContr) {
61 verifyConnectPermission(subContr.mainType, sender);
62 subContr.addPort(port, eventCache);
63 } else {
64 try {
65 await createController(sender.type, port, eventCache);
66 } catch (e) {
67 console.error(e);
68 port.postMessage({event: 'terminate'});
69 }
70 }
71 }
72}
73
74const addPortQueue = new PromiseQueue();

Callers

nothing calls this directly

Calls 5

parseViewNameFunction · 0.90
verifyConnectPermissionFunction · 0.90
createControllerFunction · 0.90
getMethod · 0.45
postMessageMethod · 0.45

Tested by

no test coverage detected