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

Function causeFilterInterruptors

packages/effect/src/internal/effect.ts:195–208  ·  view source on GitHub ↗
(
  self: Cause.Cause<E>
)

Source from the content-addressed store, hash-verified

193
194/** @internal */
195export const causeFilterInterruptors = <E>(
196 self: Cause.Cause<E>
197): Result.Result<Set<number>, Cause.Cause<E>> => {
198 let interruptors: Set<number> | undefined
199 for (let i = 0; i < self.reasons.length; i++) {
200 const f = self.reasons[i]
201 if (f._tag !== "Interrupt") continue
202 interruptors ??= new Set()
203 if (f.fiberId !== undefined) {
204 interruptors.add(f.fiberId)
205 }
206 }
207 return interruptors ? Result.succeed(interruptors) : Result.fail(self)
208}
209
210/** @internal */
211export const causeInterruptors = <E>(self: Cause.Cause<E>): ReadonlySet<number> => {

Callers 1

causeInterruptorsFunction · 0.85

Calls 3

addMethod · 0.65
succeedMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected