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

Function stream

src/core.ts:216–229  ·  view source on GitHub ↗
(path: PropertyPath, args: RpcPayload)

Source from the content-addressed store, hash-verified

214 // undefined is returned, indicating the caller should await the promise to serialize writes
215 // (no overlapping).
216 stream(path: PropertyPath, args: RpcPayload): {promise: Promise<void>, size?: number} {
217 // Default implementation: delegate to call() + pull(). No size is returned, so the caller
218 // knows this is a local call and should await the promise directly.
219 let hook = this.call(path, args);
220 let pulled = hook.pull();
221 let promise: Promise<void>;
222 if (pulled instanceof Promise) {
223 promise = pulled.then(p => { p.dispose(); });
224 } else {
225 pulled.dispose();
226 promise = Promise.resolve();
227 }
228 return { promise };
229 }
230
231 // Apply a map operation.
232 //

Callers

nothing calls this directly

Calls 5

thenMethod · 0.80
disposeMethod · 0.65
callMethod · 0.45
pullMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…