( self: Schedule.Schedule<Out, In, Env>, now: number, inputs: Chunk.Chunk<In>, state: any, acc: Chunk.Chunk<Out> )
| 1341 | |
| 1342 | /** @internal */ |
| 1343 | const runLoop = <Env, In, Out>( |
| 1344 | self: Schedule.Schedule<Out, In, Env>, |
| 1345 | now: number, |
| 1346 | inputs: Chunk.Chunk<In>, |
| 1347 | state: any, |
| 1348 | acc: Chunk.Chunk<Out> |
| 1349 | ): Effect.Effect<Chunk.Chunk<Out>, never, Env> => { |
| 1350 | if (!Chunk.isNonEmpty(inputs)) { |
| 1351 | return core.succeed(acc) |
| 1352 | } |
| 1353 | const input = Chunk.headNonEmpty(inputs) |
| 1354 | const nextInputs = Chunk.tailNonEmpty(inputs) |
| 1355 | return core.flatMap(self.step(now, input, state), ([state, out, decision]) => { |
| 1356 | if (ScheduleDecision.isDone(decision)) { |
| 1357 | return core.sync(() => pipe(acc, Chunk.prepend(out))) |
| 1358 | } |
| 1359 | return runLoop( |
| 1360 | self, |
| 1361 | Intervals.start(decision.intervals), |
| 1362 | nextInputs, |
| 1363 | state, |
| 1364 | Chunk.prepend(acc, out) |
| 1365 | ) |
| 1366 | }) |
| 1367 | } |
| 1368 | |
| 1369 | /** @internal */ |
| 1370 | export const secondOfMinute = (second: number): Schedule.Schedule<number> => |
no test coverage detected