// ets_tracing: off import type * as P from "../../../../Promise/index.js" import * as CH from "../../Channel/index.js" import * as C from "../core.js" /** * Interrupts the evaluation of this stream when the provided promise resolves. This * combinator will also interrupt any in-progress element being pulled from upstream. * * If the promise completes with a failure, the stream will emit that failure. */ export function interruptWhenP_( self: C.Stream, p: P.Promise ): C.Stream { return new C.Stream(CH.interruptWhenP_(self.channel, p)) } /** * Interrupts the evaluation of this stream when the provided promise resolves. This * combinator will also interrupt any in-progress element being pulled from upstream. * * If the promise completes with a failure, the stream will emit that failure. * * @ets_data_first interruptWhenP_ */ export function interruptWhenP(p: P.Promise) { return (self: C.Stream) => interruptWhenP_(self, p) }