<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi, <br>
<br>
I'm not quite clear on what you want to do, but it appears that
you want to discard messages if they are "too old", for some
definition of too old, and you are proposing a combination of ETS
and gen-server to do this. <br>
<br>
Why not simply discard messages that are too old when you read
them, and read the next? That, coupled with having no synchronous
send/reads to stall your process, and you are golden. <br>
<br>
Or have I missed something? <br>
<br>
Ian<br>
<br>
On 30/10/2012 11:08, Maruthavanan Subbarayan wrote:<br>
</div>
<blockquote cite="mid:BLU002-W552519A08BFCF68B646C96E3620@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<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>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>