MCPcopy
hub / github.com/hcengineering/platform / read

Method read

plugins/recorder-resources/src/stream.ts:26–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 private awaitingResolve: ((val: ChunkReadResult | Promise<ChunkReadResult>) => void) | null = null
25
26 public async read (): Promise<ChunkReadResult> {
27 if (this.done && this.chunks.length === 0) {
28 return { done: true, value: undefined }
29 }
30 if (this.chunks.length === 0) {
31 return await new Promise<ChunkReadResult>((resolve) => {
32 this.awaitingResolve = resolve
33 })
34 }
35 return { done: false, value: this.chunks.shift() }
36 }
37
38 public push (blob: Blob): void {
39 if (this.done) {

Callers 15

pushMethod · 0.95
closeMethod · 0.95
restoreMarkupRefsMongoFunction · 0.45
getFilesMethod · 0.45
getFilesMethod · 0.45
makeAttachmentPartMethod · 0.45
isHeadHunterFunction · 0.45
createServerFunction · 0.45
createServerFunction · 0.45
resolveMarkdownMethod · 0.45
resolveAttachmentsMethod · 0.45

Calls 1

shiftMethod · 0.80

Tested by

no test coverage detected