<div dir="ltr">I think the "zero to inifinity" statement might need some clarification: The timeout is a 32-bit integer and if you try to set it higher it will fail with a bad receive timeout value.<div><br></div>
<div>receive after 1 bsl 32 -1 -> ok end. will work.</div><div>receive after 1 bsl 32 -> ok end. will not.<br></div><div><br></div><div>Cheers!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 21, 2014 at 8:25 AM, Avinash Dhumane <span dir="ltr"><<a href="mailto:avinash_dhumane@balinlabs.com" target="_blank">avinash_dhumane@balinlabs.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-IN" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="color:#1f497d">Just thought of sharing the information
that Joe’s book (pp 143-144, under section “Receive with Timeout
Value of Zero/Infinity”) answers this question. I had gone over these
paragraphs several times in the past, but it is only after confronted with a
real life situation where these constructs require application of mind that these
small paragraphs illumined their real meaning. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Oh, Erlang – you’re
beauty!!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:erlang-questions-bounces@erlang.org" target="_blank">erlang-questions-bounces@erlang.org</a>
[mailto:<a href="mailto:erlang-questions-bounces@erlang.org" target="_blank">erlang-questions-bounces@erlang.org</a>] <b>On Behalf Of </b>Avinash
Dhumane<br>
<b>Sent:</b> 19 January 2014 15:58<br>
<b>To:</b> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<b>Subject:</b> [erlang-questions] Question on "selective receive"<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Can the timeout clause not have a guard too?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If it can, what are the semantics of it? I mean, if the
timeout occurs but guard evaluates to false, what happens to receive? Does it
continue to block?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If it cannot, why?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal">Avinash<u></u><u></u></p>
</div></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></div></div>