Do not use timer module. Use erlang:send_after/3<br>In my experience the timer module is unreliable and send_after will always work.<br><br><br>Sergej<br><br><div class="gmail_quote">On Tue, Oct 30, 2012 at 12:08 PM, Maruthavanan Subbarayan <span dir="ltr"><<a href="mailto:maruthavanan_s@hotmail.com" target="_blank">maruthavanan_s@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hi,<div><br></div><div>I have to develop a caching queue, which also should should after a expiry time.</div><div><br></div><div>I may have around 500+ messages which may come in a second. Each message might contain 100-200 bytes.</div>
<div><br></div><div>So I have designed the system like below.</div><div><br></div><div>1. Queue would be a gen server.</div><div>2. All messages which would come on same second would be stored in state of the gen_server like a record {datetime(),[<list of messages>]}</div>
<div>3. When the time differs, I would insert the above record to ets table and update the state of gen_server.</div><div>4. There would be a timer running timer:send_interval which would message timeout the gen_server for every second, when this message is received, then gen_server would delete the ets table according to expiry configured.</div>
<div><br></div><div>I was looking on some guidance to check if the above is fine and with with stand the performance. I am foreseeing maximum expiry would be around 60 minutes.</div><div><br></div><div>Thanks,</div><div>Marutha</div>
</div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br>