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

Function cancelResponseBody

packages/platform/deno/src/DenoHttpServer.ts:516–522  ·  view source on GitHub ↗
(body: HttpBody.HttpBody)

Source from the content-addressed store, hash-verified

514}
515
516const cancelResponseBody = (body: HttpBody.HttpBody): Effect.Effect<void> => {
517 const stream = (body as any).body
518 if ((body._tag === "Raw" || body._tag === "Uint8Array") && stream instanceof ReadableStream) {
519 return Effect.ignoreCause(Effect.promise(() => stream.cancel()))
520 }
521 return Effect.void
522}
523
524const emptyReadableStream = new ReadableStream<Uint8Array>({
525 start(controller) {

Callers 1

DenoHttpServer.tsFile · 0.70

Calls 1

cancelMethod · 0.45

Tested by

no test coverage detected