// ets_tracing: off import * as CS from "../../../../Cause/index.js" import type * as CL from "../../../../Clock/index.js" import * as T from "../../../../Effect/index.js" import * as M from "../../../../Managed/index.js" import * as O from "../../../../Option/index.js" import type * as C from "../core.js" import * as FromPull from "./fromPull.js" import * as ToPull from "./toPull.js" /** * Fails the stream with given cause if it does not produce a value after d duration. */ export function timeoutFailCause_( self: C.Stream, cause: CS.Cause, d: number ): C.Stream { return FromPull.fromPull( M.map_(ToPull.toPull(self), (pull) => T.timeoutFailCause_(pull, () => CS.map_(cause, (_) => O.some(_)), d) ) ) } /** * Fails the stream with given cause if it does not produce a value after d duration. * * @ets_data_first timeoutFailCause_ */ export function timeoutFailCause(cause: CS.Cause, d: number) { return (self: C.Stream) => timeoutFailCause_(self, cause, d) }