MCPcopy Create free account
hub / github.com/effect-app/libs / fromAsyncIterable

Function fromAsyncIterable

repos/effect/packages/effect/src/Channel.ts:1687–1703  ·  view source on GitHub ↗
(
  iterable: AsyncIterable<A, D>,
  onError: (error: unknown) => E
)

Source from the content-addressed store, hash-verified

1685 try: () => writer.ready.then(() => writer.write(value)),
1686 catch: options.onError
1687 }),
1688 { discard: true }
1689 )
1690 ),
1691 Effect.forever({ disableYield: true })
1692 )
1693 const withClose = options.closeOnDone !== false
1694 ? Pull.catchDone(loop, (done) =>
1695 Effect.andThen(
1696 Effect.tryPromise({
1697 try: () => writer.close(),
1698 catch: options.onError
1699 }),
1700 Cause.done(done)
1701 ))
1702 : loop
1703 return Effect.onError(
1704 withClose,
1705 (cause) =>
1706 Pull.isDoneCause(cause)

Callers 1

fromAsyncIterableArrayFunction · 0.70

Calls 5

addFinalizerMethod · 0.80
doneMethod · 0.80
fromTransformFunction · 0.70
nextMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…