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

Function deliver

packages/sql/pg/src/PgConnection.ts:2125–2137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2123 }
2124
2125 const deliver = (): void => {
2126 if (pending === undefined) return
2127 const resume = pending
2128 if (buffer.length > 0) {
2129 const chunk = buffer as Arr.NonEmptyArray<Row>
2130 buffer = []
2131 pending = undefined
2132 resume(Effect.succeed(chunk))
2133 } else if (finished) {
2134 pending = undefined
2135 resume(failure !== undefined ? Effect.fail(failure) : Cause.done())
2136 }
2137 }
2138
2139 const onFatal = (error: SqlError): void => {
2140 if (done) return

Callers 4

onFatalFunction · 0.70
onMessageFunction · 0.70
onBatchEndFunction · 0.70
streamRowsFunction · 0.70

Calls 4

failMethod · 0.65
resumeFunction · 0.50
succeedMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected