// ets_tracing: off import type * as CL from "../../../../Clock/index.js" import * as E from "../../../../Either/index.js" import * as O from "../../../../Option/index.js" import type * as SC from "../../../../Schedule/index.js" import type * as C from "../core.js" import * as Collect from "./collect.js" import * as RepeatEither from "./repeatEither.js" /** * Repeats the entire stream using the specified schedule. The stream will execute normally, * and then repeat again according to the provided schedule. */ export function repeatSchedule_( self: C.Stream, schedule: SC.Schedule ): C.Stream { return Collect.collect_( RepeatEither.repeatEither_(self, schedule), E.fold( (_) => O.none, (a) => O.some(a) ) ) } /** * Repeats the entire stream using the specified schedule. The stream will execute normally, * and then repeat again according to the provided schedule. * * @ets_data_first repeat_ */ export function repeatSchedule(schedule: SC.Schedule) { return (self: C.Stream) => repeatSchedule_(self, schedule) }