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

Function toChannel

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

Source from the content-addressed store, hash-verified

2993
2994/** @internal */
2995export const toChannel = <A, E, R>(
2996 stream: Stream.Stream<A, E, R>
2997): Channel.Channel<Chunk.Chunk<A>, unknown, E, unknown, unknown, unknown, R> => {
2998 if ("channel" in stream) {
2999 return (stream as StreamImpl<A, E, R>).channel
3000 } else if (Effect.isEffect(stream)) {
3001 return toChannel(fromEffect(stream)) as any
3002 } else {
3003 throw new TypeError(`Expected a Stream.`)
3004 }
3005}
3006
3007/** @internal */
3008export const mailboxToStream = <A, E>(self: Mailbox.ReadonlyMailbox<A, E>): Stream.Stream<A, E> =>

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