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

Function fromTransformBracket

repos/effect/packages/effect/src/Channel.ts:388–406  ·  view source on GitHub ↗
(
  f: (
    upstream: Pull.Pull<InElem, InErr, InDone>,
    scope: Scope.Scope,
    forkedScope: Scope.Scope
  ) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, EnvX>, EX, Env>
)

Source from the content-addressed store, hash-verified

386 * pulls, but also provides a forked scope that closes when the resulting
387 * Channel completes.
388 *
389 * **When to use**
390 *
391 * Use when building channels that require scoped resource lifecycle management,
392 * providing both the channel scope and a forked scope that automatically closes
393 * when the channel completes.
394 *
395 * @see {@link fromTransform} for a simpler transformation without a forked scope
396 * @category constructors
397 * @since 4.0.0
398 */
399export const fromTransformBracket = <OutElem, OutErr, OutDone, InElem, InErr, InDone, EX, EnvX, Env>(
400 f: (
401 upstream: Pull.Pull<InElem, InErr, InDone>,
402 scope: Scope.Scope,
403 forkedScope: Scope.Scope
404 ) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, EnvX>, EX, Env>
405): Channel<OutElem, Pull.ExcludeDone<OutErr> | EX, OutDone, InElem, InErr, InDone, Env | EnvX> =>
406 fromTransform(
407 Effect.fnUntraced(function*(upstream, scope) {
408 const closableScope = Scope.forkUnsafe(scope)
409 const onCause = (cause: Cause.Cause<EX | OutErr | Cause.Done<OutDone>>) =>

Callers 3

acquireUseReleaseFunction · 0.85
mapEffectConcurrentFunction · 0.85
Channel.tsFile · 0.85

Calls 3

onErrorMethod · 0.80
fromTransformFunction · 0.70
fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…