Overriding the clock is a pain - especially since ...
# forkhandles
d
Overriding the clock is a pain - especially since Clock is a class and NOT an interface. Really time4k is just a function to get around that annoyance. (Plus of course the DeterministicScheduler which is ace. 🙂
a
A minor pain imo 🤷 . Tbh I wrote a utility function in the utility library I import into every project, and it gives me a nice
fun Instant.toClock()
that I always use. I guess I would have preferred that
time4k
add extensions for
java.time.Clock
rather than replace it, but that's just my opinion.
The
DeterministicScheduler
seems really cool. I guess I just prefer to avoid schedulers entirely; delegate to a cloudwatch scheduled trigger feeding into an SQS queue instead 🤷