import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/scheduleEither";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/collect";
/**
 * Schedules the output of the stream using the provided `schedule`.
 *
 * @tsplus fluent ets/Stream schedule
 */

export function schedule_(self, schedule, __tsplusTrace) {
  return tsplus_module_4.collect_(tsplus_module_3.scheduleEither_(self, schedule, __tsplusTrace), either => tsplus_module_1.isRight(either) ? tsplus_module_2.some(either.right) : tsplus_module_2.none, __tsplusTrace);
}
/**
 * Schedules the output of the stream using the provided `schedule`.
 *
 * @tsplus static ets/Stream/Aspects schedule
 */

export const schedule = (schedule, __tsplusTrace) => self => schedule_(self, schedule, __tsplusTrace);
//# sourceMappingURL=schedule.mjs.map