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

Function toPull

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

Source from the content-addressed store, hash-verified

7071
7072/** @internal */
7073export const toPull = <A, E, R>(
7074 self: Stream.Stream<A, E, R>
7075): Effect.Effect<Effect.Effect<Chunk.Chunk<A>, Option.Option<E>, R>, never, R | Scope.Scope> =>
7076 Effect.map(channel.toPull(toChannel(self)), (pull) =>
7077 pipe(
7078 pull,
7079 Effect.mapError(Option.some),
7080 Effect.flatMap(Either.match({
7081 onLeft: () => Effect.fail(Option.none()),
7082 onRight: Effect.succeed
7083 }))
7084 ))
7085
7086/** @internal */
7087export const toQueue = dual<

Callers 1

stream.tsFile · 0.70

Calls 4

toChannelFunction · 0.70
pipeFunction · 0.70
mapMethod · 0.65
failMethod · 0.65

Tested by

no test coverage detected