// ets_tracing: off import type { Cause } from "../Cause/cause.js" import { halt as effectHalt } from "../Effect/core.js" import { completeWith } from "./completeWith.js" import type { Promise } from "./promise.js" /** * Halts the promise with the specified cause, which will be propagated to all * fibers waiting on the value of the promise. */ export function halt_(promise: Promise, e: Cause) { return completeWith(effectHalt(e))(promise) } /** * Halts the promise with the specified cause, which will be propagated to all * fibers waiting on the value of the promise. */ export function halt(e: Cause) { return (promise: Promise) => halt_(promise, e) }