<html><head><base href="x-msg://41/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>You can check my implementation of same issue...</div><div><a href="https://github.com/fogfish/cache">https://github.com/fogfish/cache</a></div><div><br></div><div>- Dmitry</div><div><br><div><div>On Oct 30, 2012, at 1:08 PM, Maruthavanan Subbarayan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 12pt; font-family: Calibri; "><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>_______________________________________________<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">http://erlang.org/mailman/listinfo/erlang-questions</a></div></blockquote></div><br></div></body></html>