MCPcopy Create free account
hub / github.com/Effect-TS/effect / flush

Method flush

packages/ui/native/src/NativeHttpClient.ts:396–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

394 if (unreadable) return fail(unreadable)
395 this.streamed = true
396 const flush = () => {
397 const chunks = exchange.chunks
398 for (const chunk of chunks) {
399 if (chunk === "") continue
400 const bytes = this.bytes(chunk)
401 if (!(bytes instanceof Uint8Array)) return fail(bytes)
402 Queue.offerUnsafe(queue, bytes)
403 }
404 // Release consumed chunks from long-lived streams.
405 chunks.length = 0
406 if (exchange.error === null) Queue.endUnsafe(queue)
407 else if (exchange.error !== undefined) {
408 fail(this.failed(exchange.error))
409 }
410 }
411 exchange.listeners.add(flush)
412 flush()
413 return flush

Callers

nothing calls this directly

Calls 4

bytesMethod · 0.95
failedMethod · 0.95
offerUnsafeMethod · 0.80
failFunction · 0.70

Tested by

no test coverage detected