import * as tsplus_module_1 from "@effect/core/io/Effect/operations/failCause";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/timeoutTo";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/flatten";
/**
 * The same as `timeout`, but instead of producing a `None` in the event of
 * timeout, it will produce the specified failure.
 *
 * @tsplus fluent ets/Effect timeoutFailCause
 */

export function timeoutFailCause_(self, cause, duration, __tsplusTrace) {
  return tsplus_module_4.flattenNow(tsplus_module_3.timeoutTo_(self, () => tsplus_module_1.failCause(cause, __tsplusTrace), tsplus_module_2.succeedNow, duration, __tsplusTrace), __tsplusTrace);
}
/**
 * The same as `timeout`, but instead of producing a `None` in the event of
 * timeout, it will produce the specified failure.
 *
 * @tsplus static ets/Effect/Aspects timeoutFailCause
 */

export const timeoutFailCause = (cause, duration, __tsplusTrace) => self => timeoutFailCause_(self, cause, duration, __tsplusTrace);
//# sourceMappingURL=timeoutFailCause.mjs.map