Closed jmerriweather closed 4 years ago
nerves_time
is a natural singleton, so I prefer it being an OTP application so that users don't have to remember to add it to their own supervision trees.
I have a laundry list of improvements to nerves_time
that I really, really thought that I'd get to by now, and it makes me sad that I haven't since they'd help in your efforts. I think that you started down the right route of making the part that persists the time to be configurable. Let's chat to see if we can work together to make RTC integration happen.
yeah agreed, moving to a Supervisor would make it very confusing for new people.
I'd love to work on improving nerves_time
Closing since merging #51.
@jmerriweather Sorry for the really long delay in getting hardware RTC support included. The plan is to put hardware RTC implementations in separate repositories and use the behaviour interface for getting nerves_time
to use them.
@fhunleth no worries, #51 looks good 👍
This PR provides support to make handlers for the storage and retrieval of the timestamp, by default it still uses file metadata. Below i've made an example of using RTC.
Could we change nerves_time to use a Supervisor instead of an Application? This would let us pass in configuration when we add the supervisor it to our supervision tree. If we did that would it mess up shoehorn, as nerves_time wouldn't have a
:mod
anymore?My test handler using rtc_ds3231 is as follows: