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

Function drainReadable

packages/platform/node-shared/src/NodeStream.ts:445–449  ·  view source on GitHub ↗
(stream: Readable, cleanup: () => void)

Source from the content-addressed store, hash-verified

443// Keep consuming after the consumer's listeners are removed, so the producer
444// can finish and any late error stays handled.
445const drainReadable = (stream: Readable, cleanup: () => void): void => {
446 cleanup()
447 const done = finished(stream, { readable: true, writable: false }, () => done())
448 stream.resume()
449}
450
451const readableToPullUnsafe = <A, E>(options: {
452 readonly scope: Scope.Scope

Callers 1

onDataFunction · 0.85

Calls 4

finishedFunction · 0.85
cleanupFunction · 0.70
resumeMethod · 0.65
doneFunction · 0.50

Tested by

no test coverage detected