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

Function cancelResponseBody

packages/platform/node/src/NodeHttpServer.ts:642–648  ·  view source on GitHub ↗
(body: HttpServerResponse["body"])

Source from the content-addressed store, hash-verified

640}
641
642const cancelResponseBody = (body: HttpServerResponse["body"]): Effect.Effect<void> => {
643 const stream = body._tag === "Raw" ? body.body : undefined
644 if (stream instanceof Readable) {
645 return Effect.sync(() => stream.destroy())
646 }
647 return Effect.void
648}
649
650const handleCause = (
651 nodeResponse: Http.ServerResponse,

Callers 1

handleResponseFunction · 0.70

Calls 1

syncMethod · 0.45

Tested by

no test coverage detected