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

Method exportPromise

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

Source from the content-addressed store, hash-verified

526 }
527
528 exportPromise(hook: StubHook): ExportId {
529 if (this.abortReason) throw this.abortReason;
530
531 // Promises always use a new ID because otherwise the recipient could miss the resolution.
532 let exportId = this.nextExportId--;
533 this.exports[exportId] = { hook, refcount: 1 };
534 this.reverseExports.set(hook, exportId);
535
536 // Automatically start resolving any promises we send.
537 this.ensureResolvingExport(exportId);
538 return exportId;
539 }
540
541 unexport(ids: Array<ExportId>): void {
542 for (let id of ids) {

Callers

nothing calls this directly

Calls 1

ensureResolvingExportMethod · 0.95

Tested by

no test coverage detected