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

Function streamBody

packages/effect/src/unstable/http/internal/compression.ts:101–109  ·  view source on GitHub ↗
(
  response: Response.HttpServerResponse,
  evaluate: () => ReadableStream<Uint8Array>,
  contentType: string | undefined
)

Source from the content-addressed store, hash-verified

99})
100
101const streamBody = (
102 response: Response.HttpServerResponse,
103 evaluate: () => ReadableStream<Uint8Array>,
104 contentType: string | undefined
105): Response.HttpServerResponse =>
106 setBodyWithoutLength(
107 response,
108 HttpBody.stream(Stream.fromReadableStream({ evaluate, onError: identity }), contentType)
109 )
110
111const singleChunkStream = (data: Uint8Array): ReadableStream<Uint8Array> =>
112 new ReadableStream({

Callers 1

compressResponseFunction · 0.85

Calls 2

setBodyWithoutLengthFunction · 0.85
streamMethod · 0.65

Tested by

no test coverage detected