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

Function toStream

packages/effect/src/unstable/httpapi/HttpApiClient.ts:874–881  ·  view source on GitHub ↗
(response: HttpClientResponse.HttpClientResponse)

Source from the content-addressed store, hash-verified

872 decoder: makeSseDecoder(streamSchema)
873 }
874 const toStream = (response: HttpClientResponse.HttpClientResponse) =>
875 Effect.map(Effect.context<never>(), (context) =>
876 Stream.provideContext(
877 sse === undefined ?
878 response.stream :
879 decodeSseStream(response.stream, sse.declaration, sse.decoder),
880 context as Context.Context<unknown>
881 ))
882 if (!isWithHeaders) return toStream
883
884 const decodeHeaders = Schema.decodeUnknownEffect(successSchema.headers)

Callers 2

streamToResponseFunction · 0.85
AtomRegistry.tsFile · 0.85

Calls 3

decodeSseStreamFunction · 0.85
contextMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected