<html>Hi, thank you, mnesia could actually be a good fit. I would have to ensure that the schema is created only once (so not being part of the docker container initialization) but that would be better than using tab2file after every write !<br /><br />I currently have a simple implementation that works well. The only problèm (really not a problem per se) is that it is just a narrow subset of the timer module. It is based on an ETS ordered_set used as a data structure with a peek function that either returns a timed-out entry or a delay to the next entry timeout ; and a gen_server that just handles `timeout` information and run the the next task and/or returns a timeout according to the delay.<br /><br />As for cron-like application I found that they do not fit well because we sometimes have to pop entries from the table and run them regardless of actual scheduled time.<br /><br />Thanks again<br /><br />Le Dimanche, Janvier 19, 2020 15:17 CET, Serge Aleynikov <serge@aleynikov.org> a écrit:<br /> <blockquote type="cite" cite="CANt451=OkSdFMBEGqWdYvp-TnyQ9pY5KFzPTCK+PmV9gzS8k4w@mail.gmail.com"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">There's a project <a style="font-family:Arial,Helvetica,sans-serif" href="https://github.com/erlware/erlcron">https://github.com/erlware/erlcron</a> that implements jobs with a timer. It presently maintains persistence through a crontab config file, but it looks like you need something more advanced, so you can take a look at the code, the core of it is just in one module ecrn_agent, and perhaps add a persistence layer.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Alternatively, switching your existing implementation to store records in a mnesia disk table would likely be the easiest approach.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Best,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Serge</div></div></blockquote></html>