MCPcopy Index your code
hub / github.com/Effect-TS/effect / toChannel

Function toChannel

packages/effect/src/internal/stream.ts:3002–3012  ·  view source on GitHub ↗
(
  stream: Stream.Stream<A, E, R>
)

Source from the content-addressed store, hash-verified

3000
3001/** @internal */
3002export const toChannel = <A, E, R>(
3003 stream: Stream.Stream<A, E, R>
3004): Channel.Channel<Chunk.Chunk<A>, unknown, E, unknown, unknown, unknown, R> => {
3005 if ("channel" in stream) {
3006 return (stream as StreamImpl<A, E, R>).channel
3007 } else if (Effect.isEffect(stream)) {
3008 return toChannel(fromEffect(stream)) as any
3009 } else {
3010 throw new TypeError(`Expected a Stream.`)
3011 }
3012}
3013
3014/** @internal */
3015export const fromChunk = <A>(chunk: Chunk.Chunk<A>): Stream.Stream<A> =>

Callers 12

accumulateChunksFunction · 0.70
stream.tsFile · 0.70
runningFunction · 0.70
drainFunction · 0.70
flattenChunksFunction · 0.70
flattenExitOptionFunction · 0.70
foreverFunction · 0.70
suspendFunction · 0.70
throttleEnforceEffectFunction · 0.70
throttleShapeEffectFunction · 0.70
toPullFunction · 0.70
zipWithNextFunction · 0.70

Calls 1

fromEffectFunction · 0.70

Tested by

no test coverage detected