Excellent! �Problem solved.<br clear="all"><br><div>Many thanks,<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>
<br><br><div class="gmail_quote">2011/7/22 Rapha�l De GIUSTI <span dir="ltr">&lt;<a href="mailto:raphael.degiusti@guardis.com">raphael.degiusti@guardis.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hello,<div><br></div><div>You should try the start_consuming() method. See the example on github :�<a href="https://github.com/pika/pika/blob/master/examples/blocking/demo_receive.py" target="_blank">https://github.com/pika/pika/blob/master/examples/blocking/demo_receive.py</a></div>


<div><br></div><div>Raph<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Jul 22, 2011 at 8:12 PM, Jim Irrer <span dir="ltr">&lt;<a href="mailto:irrer@umich.edu" target="_blank">irrer@umich.edu</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
Hi -<div><br></div><div>I&#39;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 &#39;sleep&#39; 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 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&#39;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" target="_blank">irrer@umich.edu</a>� � �� <a href="tel:%28734%29%20647-4409" value="+17346474409" target="_blank">(734) 647-4409</a><br>

University of Michigan Hospital Radiation Oncology<br>519 W. William St.� � � � � �� Ann Arbor, MI 48103<br>



</div>
<br></div></div>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>