import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/interruptWhen";
import { concreteStream, StreamInternal } from "@effect/core/stream/Stream/operations/_internal/StreamInternal";
/**
 * Interrupts the evaluation of this stream when the provided effect completes.
 * The given effect will be forked as part of this stream, and its success will
 * be discarded. This combinator will also interrupt any in-progress element
 * being pulled from upstream.
 *
 * If the effect completes with a failure before the stream completes, the
 * returned stream will emit that failure.
 *
 * @tsplus fluent ets/Stream interruptWhen
 */

export function interruptWhen_(self, effect, __tsplusTrace) {
  void 0;
  return new StreamInternal(tsplus_module_1.interruptWhen_(self.channel, effect));
}
/**
 * Interrupts the evaluation of this stream when the provided effect completes.
 * The given effect will be forked as part of this stream, and its success will
 * be discarded. This combinator will also interrupt any in-progress element
 * being pulled from upstream.
 *
 * If the effect completes with a failure before the stream completes, the
 * returned stream will emit that failure.
 *
 * @tsplus static ets/Stream/Aspects interruptWhen
 */

export const interruptWhen = (effect, __tsplusTrace) => self => interruptWhen_(self, effect, __tsplusTrace);
//# sourceMappingURL=interruptWhen.mjs.map