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

Function backend

packages/sql/pg/test/PgPool.in-process.test.ts:756–772  ·  view source on GitHub ↗
(response: Buffer, options?: Pick<DuplexOptions, "destroy">)

Source from the content-addressed store, hash-verified

754
755 // A backend that completes startup and answers every Parse with `response`.
756 const backend = (response: Buffer, options?: Pick<DuplexOptions, "destroy">) => {
757 let startup = true
758 const socket: Duplex = new Duplex({
759 ...options,
760 read() {},
761 write(chunk: Buffer, _encoding, callback) {
762 if (startup) {
763 startup = false
764 queueMicrotask(() => socket.push(ready))
765 } else if (chunk[0] === 0x50) {
766 queueMicrotask(() => socket.push(response))
767 }
768 callback()
769 }
770 })
771 return socket
772 }
773
774 it.effect.each([
775 {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected