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

Method interruptUnsafe

packages/effect/src/internal/effect.ts:573–594  ·  view source on GitHub ↗
(fiberId?: number | undefined, annotations?: Context.Context<never> | undefined)

Source from the content-addressed store, hash-verified

571 }
572 }
573 interruptUnsafe(fiberId?: number | undefined, annotations?: Context.Context<never> | undefined): void {
574 if (this._exit) {
575 return
576 }
577 let cause = causeInterrupt(fiberId)
578 if (this.currentStackFrame) {
579 cause = causeAnnotate(cause, Context.make(CauseStackTrace, this.currentStackFrame))
580 }
581 if (annotations) {
582 cause = causeAnnotate(cause, annotations)
583 }
584 this._interruptedCause = this._interruptedCause
585 ? causeCombine(this._interruptedCause, cause)
586 : cause
587 if (this.interruptible) {
588 if (this._running) {
589 this._deferredInterrupt = true
590 } else {
591 this.evaluate(failCause(this._interruptedCause) as any)
592 }
593 }
594 }
595 pollUnsafe(): Exit.Exit<A, E> | undefined {
596 return this._exit
597 }

Callers 15

BrowserRuntime.tsFile · 0.80
onSigintFunction · 0.80
onSigintFunction · 0.80
handlerFunction · 0.80
handlerFunction · 0.80
makeHandlerFunction · 0.80
makeUpgradeHandlerFunction · 0.80
Fiber.test.tsFile · 0.80
Semaphore.test.tsFile · 0.80
Effect.test.tsFile · 0.80

Calls 4

evaluateMethod · 0.95
causeInterruptFunction · 0.85
makeMethod · 0.65
failCauseFunction · 0.50

Tested by

no test coverage detected