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

Function stream

packages/effect/src/unstable/http/HttpServerResponse.ts:448–466  ·  view source on GitHub ↗
(
  body: Stream.Stream<Uint8Array, E>,
  options?: Options | undefined
)

Source from the content-addressed store, hash-verified

446 * @since 4.0.0
447 */
448export const stream = <E>(
449 body: Stream.Stream<Uint8Array, E>,
450 options?: Options | undefined
451): HttpServerResponse => {
452 const headers = options?.headers
453 ? Headers.fromInput(options.headers)
454 : Headers.empty
455 return makeResponse({
456 status: options?.status ?? 200,
457 statusText: options?.statusText,
458 headers,
459 cookies: options?.cookies,
460 body: Body.stream(
461 body,
462 getContentType(options, headers),
463 options?.contentLength
464 )
465 })
466}
467
468const HttpPlatformKey = Context.Service<
469 HttpPlatform,

Callers 1

htmlStreamFunction · 0.70

Calls 3

getContentTypeFunction · 0.85
makeResponseFunction · 0.70
streamMethod · 0.65

Tested by

no test coverage detected