Hyperlinkv0.8.0-beta.28

Cause

Cause.interruptorsconsteffect/Cause.ts:1031
<E>(self: Cause<E>): ReadonlySet<number>

Collects the defined fiber IDs from all Interrupt reasons in the cause into a ReadonlySet. Interrupt reasons without a fiberId are ignored. Returns an empty set when the cause has no interrupting fiber IDs.

When to use

Use when you need interrupting fiber IDs as a set, with absence represented as an empty set.

Example (Collecting interruptors)

import { Cause } from "effect"

const cause = Cause.combine(
  Cause.interrupt(1),
  Cause.interrupt(2)
)

console.log(Cause.interruptors(cause)) // Set(2) { 1, 2 }
Source effect/Cause.ts:10311 lines
export const interruptors: <E>(self: Cause<E>) => ReadonlySet<number> = effect.causeInterruptors