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

Function backendMessage

packages/sql/pg/test/PgPool.in-process.test.ts:13–17  ·  view source on GitHub ↗
(tag: string, payload: Buffer)

Source from the content-addressed store, hash-verified

11import { Duplex, type DuplexOptions } from "node:stream"
12
13const backendMessage = (tag: string, payload: Buffer): Buffer => {
14 const length = Buffer.allocUnsafe(4)
15 length.writeInt32BE(payload.length + 4)
16 return Buffer.concat([Buffer.from(tag), length, payload])
17}
18
19const ready = Buffer.concat([
20 backendMessage("R", Buffer.alloc(4)),

Callers 4

completedFunction · 0.70
failedFunction · 0.70
writeFunction · 0.70

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected