/** * Fails the stream with given cause if it does not produce a value after the * specified duration. * * @tsplus static effect/core/stream/Stream.Aspects timeoutFailCause * @tsplus pipeable effect/core/stream/Stream timeoutFailCause */ export function timeoutFailCause(cause: LazyArg>, duration: Duration) { return (self: Stream): Stream => Stream.fromPull( self.toPull.map((pull) => pull.timeoutFailCause(cause().map(Maybe.some), duration)) ) }