<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="ydpe4d90ffdyahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
<div><br></div><div>Mnesia would handle millions of disk persistented terms. Assuming in this case youl only be calling :mnesia.next or dirty_next, and comparing the time on it, itl be super low latency and fast. Inserts are also very fast into ordered_set. <br></div>
</div><div id="yahoo_quoted_5994552609" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Tuesday, December 18, 2018, 10:01:53 a.m. EST, Frank Muller <frank.muller.erl@gmail.com> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv4294562547"><div><div><div>Hi Vans</div></div><div><br clear="none"></div><div>I always ask first before re-implementing the wheel. The link is very good (did my home work and read almost all papers on the subject before asking).</div><div><br clear="none"></div><div>@Vans: thanks for implementation hints.</div><div>What do you suggest for persistency? Is mnesia capable of handling millions terms?</div><div><br clear="none"></div><div>Best</div><div>/Frank</div><div class="yiv4294562547yqt6410397277" id="yiv4294562547yqt13106"><div><div class="yiv4294562547gmail_quote"><div dir="ltr"><br clear="none"></div><blockquote class="yiv4294562547gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="yiv4294562547m_6619496175321963977ydpf6d7904yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
<div>Why dont you write your own, since this is a special use case anyways that has a ton of implementations, there is no way youl find an implemenation that will fully satisfy you. Its quite simple too, <a rel="nofollow" shape="rect" class="yiv4294562547m_6619496175321963977enhancr_card_6085030597" target="_blank" href="https://paulcavallaro.com/blog/hashed-and-hierarchical-timing-wheels/">Hashed and Hierarchical Timing Wheels</a>, scheme #2 here will be VERY performant on erlang. an ordered_set mnesia table, using dirty_next to get the first element each 1-10ms to check if a timer is ready to pop. Then spawn a new process and pass the event for handling to it.</div><div><br clear="none"></div><div class="yiv4294562547m_6619496175321963977ydpbd5762fbyahoo-link-enhancr-card yiv4294562547m_6619496175321963977ydpbd5762fbyahoo-link-enhancr-not-allow-cover yiv4294562547m_6619496175321963977ydpbd5762fbymail-preserve-class yiv4294562547m_6619496175321963977ydpbd5762fbymail-preserve-style" id="yiv4294562547m_6619496175321963977ydpbd5762fbenhancr_card_6085030597" style="max-width:400px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;"><a rel="nofollow" shape="rect" class="yiv4294562547m_6619496175321963977ydpbd5762fbyahoo-enhancr-cardlink" target="_blank" href="https://paulcavallaro.com/blog/hashed-and-hierarchical-timing-wheels/" style="text-decoration:none!important;color:#000!important;"><table class="yiv4294562547m_6619496175321963977ydpbd5762fbcard-wrapper yiv4294562547m_6619496175321963977ydpbd5762fbyahoo-ignore-table" border="0" cellpadding="0" cellspacing="0" style="max-width:400px;"><tbody><tr><td colspan="1" rowspan="1" width="400"><table class="yiv4294562547m_6619496175321963977ydpbd5762fbcard yiv4294562547m_6619496175321963977ydpbd5762fbyahoo-ignore-table" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224,228,233);border-radius:2px;"><tbody><tr><td colspan="1" rowspan="1"><table class="yiv4294562547m_6619496175321963977ydpbd5762fbcard-info yiv4294562547m_6619496175321963977ydpbd5762fbyahoo-ignore-table" border="0" cellpadding="0" cellspacing="0" style="background:#fff;width:100%;max-width:400px;border-radius:0 0 2px 2px;border-top:1px solid rgb(224,228,233);"><tbody><tr><td colspan="1" rowspan="1" style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"></td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0;"><h2 class="yiv4294562547m_6619496175321963977ydpbd5762fbcard-title" style="font-size:14px;line-height:19px;margin:0px 0px 6px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;color:rgb(38,40,42);">Hashed and Hierarchical Timing Wheels</h2><p class="yiv4294562547m_6619496175321963977ydpbd5762fbcard-description" style="font-size:12px;line-height:16px;margin:0px;color:rgb(151,155,167);">Hashed and Hierarchical Timing Wheels: Data Structures for the Efficient Implementation of a Timing Facility</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div>
</div></div><div><div class="yiv4294562547m_6619496175321963977yahoo_quoted" id="yiv4294562547m_6619496175321963977yahoo_quoted_5957456733">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Tuesday, December 18, 2018, 1:22:44 a.m. EST, Torben Hoffmann <<a rel="nofollow" shape="rect" ymailto="mailto:torben.lehoff@gmail.com" target="_blank" href="mailto:torben.lehoff@gmail.com">torben.lehoff@gmail.com</a>> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="yiv4294562547m_6619496175321963977yiv9190438820"><div>This is the nearest I can think of:<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="https://github.com/fra/ecron/blob/master/README.md">https://github.com/fra/ecron/blob/master/README.md</a><br clear="none"><br clear="none">Cheers,<br clear="none">Torben<br clear="none"><div class="yiv4294562547m_6619496175321963977yiv9190438820gmail_quote"><div class="yiv4294562547m_6619496175321963977yiv9190438820yqt1121191909" id="yiv4294562547m_6619496175321963977yiv9190438820yqtfd32685"><div dir="ltr">On Tue, 18 Dec 2018 at 06:17, Frank Muller <<a rel="nofollow" shape="rect" ymailto="mailto:frank.muller.erl@gmail.com" target="_blank" href="mailto:frank.muller.erl@gmail.com">frank.muller.erl@gmail.com</a>> wrote:<br clear="none"></div></div><blockquote class="yiv4294562547m_6619496175321963977yiv9190438820gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv4294562547m_6619496175321963977yiv9190438820yqt1121191909" id="yiv4294562547m_6619496175321963977yiv9190438820yqtfd62327"><div><div>Really, no library out there?</div></div><div><br clear="none"></div><div>/Frank</div><div><br clear="none"></div><div><div class="yiv4294562547m_6619496175321963977yiv9190438820gmail_quote"><blockquote class="yiv4294562547m_6619496175321963977yiv9190438820gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Hi there </div><div><br clear="none"></div><div>I am looking for any Erlang implementation of a “hierarchical timing wheel” with disk persistency (if possible)?</div><div><br clear="none"></div><div>I need to handle a very large number of timers (around 10 million events) in my app. Each timer will trigger an associated MFA event. </div><div><br clear="none"></div><div>I’ve one special case: some events can be triggered after a long period of time (ex. 2 years). The rest of the timers can be considered short (in minutes, hours or days at max). That’s why “<span style="font-size:12pt;font-family:Helvetica;">hierarchical timing wheel” can solve this special case.</span></div><div><br clear="none"></div><div>Any help/idea/link appreciated.</div><div><br clear="none"></div><div>Thank you</div><div>/Frank</div>
</blockquote></div></div>
_______________________________________________<br clear="none">
erlang-questions mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></div><br clear="none">
</blockquote></div>-- <br clear="none"><div class="yiv4294562547m_6619496175321963977yiv9190438820gmail_signature" dir="ltr"><div dir="ltr"><a rel="nofollow" shape="rect" target="_blank" href="https://www.linkedin.com/in/torbenhoffmann/">https://www.linkedin.com/in/torbenhoffmann/</a><div class="yiv4294562547m_6619496175321963977yiv9190438820yqt1121191909" id="yiv4294562547m_6619496175321963977yiv9190438820yqtfd36590"><br clear="none"></div></div></div></div></div><div class="yiv4294562547m_6619496175321963977yqt1121191909" id="yiv4294562547m_6619496175321963977yqtfd09541">_______________________________________________<br clear="none">erlang-questions mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br clear="none"></div></div>
</div>
</div></div></blockquote></div></div></div></div></div></div>
</div>
</div></body></html>