"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.interrupt = void 0
// tracing: off
const core_1 = require("../Effect/core")
const fiberId_1 = require("../Effect/fiberId")
const interruption_1 = require("../Effect/interruption")
const completeWith_1 = require("./completeWith")
/**
 * Completes the promise with interruption. This will interrupt all fibers
 * waiting on the value of the promise as by the fiber calling this method.
 */
function interrupt(promise) {
  return (0, core_1.chain_)(fiberId_1.fiberId, (id) =>
    (0, completeWith_1.completeWith)((0, interruption_1.interruptAs)(id))(promise)
  )
}
exports.interrupt = interrupt
//# sourceMappingURL=interrupt.js.map
