MCPcopy
hub / github.com/cloudflare/capnweb / exportStub

Method exportStub

src/rpc.ts:512–526  ·  view source on GitHub ↗
(hook: StubHook)

Source from the content-addressed store, hash-verified

510 }
511
512 exportStub(hook: StubHook): ExportId {
513 if (this.abortReason) throw this.abortReason;
514
515 let existingExportId = this.reverseExports.get(hook);
516 if (existingExportId !== undefined) {
517 ++this.exports[existingExportId].refcount;
518 return existingExportId;
519 } else {
520 let exportId = this.nextExportId--;
521 this.exports[exportId] = { hook, refcount: 1 };
522 this.reverseExports.set(hook, exportId);
523 // TODO: Use onBroken().
524 return exportId;
525 }
526 }
527
528 exportPromise(hook: StubHook): ExportId {
529 if (this.abortReason) throw this.abortReason;

Callers 1

sendMapMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected