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