Hyperlinkv0.8.0-beta.28

Effect

Effect.interruptibleconsteffect/Effect.ts:7266
<A, E, R>(self: Effect<A, E, R>): Effect<A, E, R>

Returns a new effect that allows the effect to be interruptible.

Example (Allowing interruption)

import { Effect } from "effect"

const longRunning = Effect.forever(Effect.succeed("working..."))

const program = Effect.interruptible(longRunning)

// This effect can now be interrupted
const fiber = Effect.runFork(program)
// Later: fiber.interrupt()
interruption
Source effect/Effect.ts:72663 lines
export const interruptible: <A, E, R>(
  self: Effect<A, E, R>
) => Effect<A, E, R> = internal.interruptible