@effect-ts/system
Version:
Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.
14 lines (11 loc) • 444 B
text/typescript
// ets_tracing: off
import * as T from "./_internal/effect.js"
import type * as Fiber from "./core.js"
/**
* Interrupts the fiber from whichever fiber is calling this method. If the
* fiber has already exited, the returned effect will resume immediately.
* Otherwise, the effect will resume when the fiber exits.
*/
export function interrupt<E, A>(fiber: Fiber.Fiber<E, A>) {
return T.chain_(T.fiberId, (id) => fiber.interruptAs(id))
}