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

Function write

packages/sql/pg/test/PgConnection.in-process.test.ts:67–79  ·  view source on GitHub ↗
(chunk: Buffer, _encoding, callback)

Source from the content-addressed store, hash-verified

65 const socket: Duplex = new Duplex({
66 read() {},
67 write(chunk: Buffer, _encoding, callback) {
68 writes.push(Buffer.from(chunk))
69 queueMicrotask(() => {
70 if (writes.length === 1) {
71 socket.push(Buffer.from(reply))
72 } else if (cancel) {
73 socket.destroy()
74 } else if (writes.length === 2) {
75 socket.push(Buffer.concat([authenticationOk, backendKeyData, readyForQuery]))
76 }
77 })
78 callback()
79 }
80 })
81 tlsOptions.set(socket, undefined)
82 return { socket, writes }

Callers

nothing calls this directly

Calls 8

frontendTagsFunction · 0.85
queryResultFunction · 0.85
fromMethod · 0.80
pushMethod · 0.65
callbackFunction · 0.50
replyFunction · 0.50
destroyMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected