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

Function toPull

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

Source from the content-addressed store, hash-verified

7109
7110/** @internal */
7111export const toPull = <A, E, R>(
7112 self: Stream.Stream<A, E, R>
7113): Effect.Effect<Effect.Effect<Chunk.Chunk<A>, Option.Option<E>, R>, never, R | Scope.Scope> =>
7114 Effect.map(channel.toPull(toChannel(self)), (pull) =>
7115 pipe(
7116 pull,
7117 Effect.mapError(Option.some),
7118 Effect.flatMap(Either.match({
7119 onLeft: () => Effect.fail(Option.none()),
7120 onRight: Effect.succeed
7121 }))
7122 ))
7123
7124/** @internal */
7125export 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