Hi -<div><br></div><div>I'm trying to implement a blocking client that does an RPC style call to a</div><div>server and get a result. Currently my client sends a message that the server</div><div>receives, and then the client immediately checks for a response using</div>
<div>basic_consume. The basic_consume method is executed before the</div><div>server can respond, and returns without getting a result.</div><div><br></div><div>If I add a 'sleep' before the basic_consume, everything works fine, but</div>
<div>that is a poor solution. I want to block until there is something on the</div><div>queue to read.</div><div><br></div><div>outline of the code:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>use channel.queue_declare to declare the reply queue</div><div><br></div><div>use queue_bind to bind the reply queue to a unique string</div><div><br></div><div>call basic_consume to set up the reply queue handler (I thought that this would block but it does not)</div>
<div><br></div><div>use basic_publish to send a message to the server, with the reply_to property set to the unique string</div><div><br></div><div>sleep long enough for server to process message (do not want to do this, but if I don't then I get no reply)</div>
<div><br></div><div>call basic_get (not sure why, but it makes things work)</div></blockquote><div><br></div><div>I have some holes in my understanding, but to not know how to make the</div><div>program wait until there is something on the queue and then read it.</div>
<div><br>Thanks for any hints,<br><br>- Jim<br><br>Jim Irrer <a href="mailto:irrer@umich.edu">irrer@umich.edu</a> (734) 647-4409<br>University of Michigan Hospital Radiation Oncology<br>519 W. William St. Ann Arbor, MI 48103<br>
</div>