Hyperlinkv0.8.0-beta.28

Channel

Channel.scopedconsteffect/Channel.ts:6648
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
): Channel<
  OutElem,
  OutErr,
  OutDone,
  InElem,
  InErr,
  InDone,
  Exclude<Env, Scope.Scope>
>

Runs a channel with a scope provided for the duration of the channel execution, removing the channel's Scope requirement.

resource management
export const scoped = <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, Scope.Scope>> =>
  fromTransformBracket((upstream, scope, forkedScope) =>
    Effect.map(
      Scope.provide(toTransform(self)(upstream, scope), forkedScope),
      Scope.provide(forkedScope)
    )
  )
Referenced by 1 symbols