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

Function end

packages/platform/node/src/NodeHttpServer.ts:1257–1268  ·  view source on GitHub ↗
(
  nodeResponse: Http.ServerResponse,
  response: HttpServerResponse,
  chunk?: string | Uint8Array
)

Source from the content-addressed store, hash-verified

1255 })
1256
1257const end = (
1258 nodeResponse: Http.ServerResponse,
1259 response: HttpServerResponse,
1260 chunk?: string | Uint8Array
1261): Effect.Effect<void> => {
1262 try {
1263 nodeResponse.end(chunk)
1264 return Effect.void
1265 } catch (defect) {
1266 return handleCause(nodeResponse, response)(Cause.die(defect))
1267 }
1268}
1269
1270// Check lengths before writing: Node's strictContentLength throws uncaught inside pipeline.
1271// Call after `writeHead`, so a rejected head can still cancel an unlocked Web stream.

Callers 1

writeResponseFunction · 0.70

Calls 2

handleCauseFunction · 0.70
endMethod · 0.65

Tested by

no test coverage detected