// 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 ScheduleEither from "./scheduleEither.js" /** * Schedules the output of the stream using the provided `schedule`. */ export function schedule_( self: C.Stream, schedule: SC.Schedule ): C.Stream { return Collect.collect_( ScheduleEither.scheduleEither_(self, schedule), E.fold( (_) => O.none, (r) => O.some(r) ) ) } /** * Schedules the output of the stream using the provided `schedule`. * * @ets_data_first schedule_ */ export function schedule(schedule: SC.Schedule) { return (self: C.Stream) => schedule_(self, schedule) }