Hi Dmitry,<div><br></div><div>Thank you for sharing your code. Do you plan to add some docs to it?</div><div><br></div><div>Do you use this project? At which state it is now?</div><div><br clear="all"><div><div>Best regards,</div>

<div>Max</div><br></div>
<br><br><div class="gmail_quote">On Thu, Mar 14, 2013 at 3:29 PM, Dmitry Kolesnikov <span dir="ltr"><<a href="mailto:dmkolesnikov@gmail.com" target="_blank">dmkolesnikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="auto"><div>Hello Max,</div><div><br></div><div>I have been experimenting with similar approach. The main idea was to keep a two ETS based indexes. The first one it key-value map, second is expire-key map. Second index allows you to handle eviction. You have a process that evict a items when they are expired. </div>

<div><br></div><div>I did a quick proto but never had opportunity to evolve it further. </div><div><span style="font-family:'.HelveticaNeueUI';font-size:15px;line-height:19px;white-space:nowrap"><a href="https://github.com/fogfish/cache" target="_blank">https://github.com/fogfish/cache</a></span><br>

<br>It would be excellent to get community comments on it.</div><div><br></div><div><br>Best Regards,<div>Dmitry >-|-|-*></div><div><br></div></div><div><div class="h5"><div><br>On 14.3.2013, at 16.15, Max Bourinov <<a href="mailto:bourinov@gmail.com" target="_blank">bourinov@gmail.com</a>> wrote:<br>

<br></div><blockquote type="cite"><div>Hi Erlangers,<div><br></div><div>How would you implement TTL with callback for ETS based cache?</div><div><br></div><div>I want when TTL expires callback is triggered and cached value goes to DB.</div>

<div><br></div><div>For key I use 32 byte long binary(), value is not bigger than 8 KB. </div>

<div><br></div><div>Any suggestions?</div><div><br></div><div>p.s. elang:send_after/3 is a most brutal approach, but how would it be when cache is under load?</div><div><br clear="all"><div><div>Best regards,</div><div>Max</div>



<br></div>
</div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>erlang-questions mailing list</span><br><span><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a></span><br>

<span><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></span><br></div></blockquote></div></blockquote></div><br></div>