@@ -32,7 +32,7 @@ import cron4s.Cron
3232import eu .timepit .fs2cron .cron4s .Cron4sScheduler
3333
3434val cronScheduler = Cron4sScheduler .systemDefault[IO ]
35- // cronScheduler: eu.timepit.fs2cron.Scheduler[IO, cron4s.expr.CronExpr] = eu.timepit.fs2cron.cron4s.Cron4sScheduler$$anon$1@25eea02a
35+ // cronScheduler: eu.timepit.fs2cron.Scheduler[IO, cron4s.expr.CronExpr] = eu.timepit.fs2cron.cron4s.Cron4sScheduler$$anon$1@45dce0d1
3636
3737val evenSeconds = Cron .unsafeParse(" */2 * * ? * *" )
3838// evenSeconds: cron4s.package.CronExpr = CronExpr(
@@ -48,9 +48,9 @@ val scheduled = cronScheduler.awakeEvery(evenSeconds) >> printTime
4848// scheduled: Stream[[x]IO[x], Unit] = Stream(..)
4949
5050scheduled.take(3 ).compile.drain.unsafeRunSync()
51- // 12:17:48.032770646
52- // 12:17:50.001097222
53- // 12:17:52.000732258
51+ // 18:34:32.033830709
52+ // 18:34:34.002803445
53+ // 18:34:36.003932580
5454```
5555``` scala
5656val everyFiveSeconds = Cron .unsafeParse(" */5 * * ? * *" )
@@ -70,15 +70,16 @@ val scheduledTasks = cronScheduler.schedule(List(
7070// scheduledTasks: Stream[IO, Unit] = Stream(..)
7171
7272scheduledTasks.take(9 ).compile.drain.unsafeRunSync()
73- // 12:17:54.001309092 task 1
74- // 12:17:55.002303004 task 2
75- // 12:17:56.001378253 task 1
76- // 12:17:58.001008992 task 1
77- // 12:18:00.001058382 task 2
78- // 12:18:00.001275186 task 1
79- // 12:18:02.001425277 task 1
80- // 12:18:04.002083568 task 1
81- // 12:18:05.001522523 task 2
73+ // 18:34:38.002958339 task 1
74+ // 18:34:40.001963407 task 1
75+ // 18:34:40.002894934 task 2
76+ // 18:34:42.002921055 task 1
77+ // 18:34:44.001824883 task 1
78+ // 18:34:45.001565622 task 2
79+ // 18:34:46.002115495 task 1
80+ // 18:34:48.002280091 task 1
81+ // 18:34:50.002275028 task 1
82+ // 18:34:50.002287163 task 2
8283```
8384
8485#### Cancelling the scheduled task
@@ -122,7 +123,7 @@ import com.github.eikek.calev.CalEvent
122123import eu .timepit .fs2cron .calev .CalevScheduler
123124
124125val calevScheduler = CalevScheduler .systemDefault[IO ]
125- // calevScheduler: eu.timepit.fs2cron.Scheduler[IO, CalEvent] = eu.timepit.fs2cron.calev.CalevScheduler$$anon$1@19ab8621
126+ // calevScheduler: eu.timepit.fs2cron.Scheduler[IO, CalEvent] = eu.timepit.fs2cron.calev.CalevScheduler$$anon$1@550e5114
126127val oddSeconds = CalEvent .unsafe(" *-*-* *:*:1/2" )
127128// oddSeconds: CalEvent = CalEvent(
128129// weekday = All,
@@ -138,9 +139,9 @@ val oddSeconds = CalEvent.unsafe("*-*-* *:*:1/2")
138139val calevScheduled = calevScheduler.awakeEvery(oddSeconds) >> printTime
139140// calevScheduled: Stream[[x]IO[x], Unit] = Stream(..)
140141calevScheduled.take(3 ).compile.drain.unsafeRunSync()
141- // 12: 18:07.018297857
142- // 12: 18:09.000317064
143- // 12: 18:11.000249817
142+ // 18:34:51.010013087
143+ // 18:34:53.001828079
144+ // 18:34:55.002820652
144145```
145146
146147``` scala
@@ -163,15 +164,15 @@ val calevScheduledTasks = calevScheduler.schedule(List(
163164// calevScheduledTasks: Stream[IO, Unit] = Stream(..)
164165
165166calevScheduledTasks.take(9 ).compile.drain.unsafeRunSync()
166- // 12: 18:12.000451379 task 2
167- // 12: 18:13.000994389 task 1
168- // 12: 18:15.000405413 task 1
169- // 12: 18:16.001177876 task 2
170- // 12: 18:17.001266828 task 1
171- // 12: 18:19.000612835 task 1
172- // 12: 18:20.000679117 task 2
173- // 12: 18:21.000881674 task 1
174- // 12: 18:23.000535002 task 1
167+ // 18:34:56.001415642 task 2
168+ // 18:34:57.002843319 task 1
169+ // 18:34:59.002381300 task 1
170+ // 18:35:00.002998250 task 2
171+ // 18:35:01.001359259 task 1
172+ // 18:35:03.002702995 task 1
173+ // 18:35:04.001411238 task 2
174+ // 18:35:05.001829119 task 1
175+ // 18:35:07.002349862 task 1
175176```
176177
177178## Using fs2-cron
@@ -181,8 +182,8 @@ The latest version of the library is available for Scala 2.12 and 2.13.
181182If you're using sbt, add the following to your build:
182183``` sbt
183184libraryDependencies ++= Seq (
184- " eu.timepit" %% " fs2-cron-cron4s" % " 0.10.2 " // and/or
185- " eu.timepit" %% " fs2-cron-calev" % " 0.10.2 "
185+ " eu.timepit" %% " fs2-cron-cron4s" % " 0.10.3 " // and/or
186+ " eu.timepit" %% " fs2-cron-calev" % " 0.10.3 "
186187)
187188```
188189
0 commit comments