2011/7/8 Michael Nacos <span dir="ltr">&lt;<a href="mailto:m.nacos@gmail.com">m.nacos@gmail.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Do you mean I could have two handlers within the same EM.run block, a &#39;subscribe&#39;  one and a &#39;on_ack&#39; one handling the publish confirms within which the queue1 ack is done? How do I know which queue1 message I&#39;m getting the on_ack notification for?</blockquote>

</div><br>You need to integrate both consumer and publishing confirms code into an object that can keep track of any additional state you need. An example of such integration:<br><br><a href="http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/GettingStarted.textile#Integration_with_objects">http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/GettingStarted.textile#Integration_with_objects</a><br clear="all">

<br>(this example does not keep track of any state but demonstrates Object#method and Method#to_proc combination technique)<br>-- <br>MK<br><br><a href="http://github.com/michaelklishin" target="_blank">http://github.com/michaelklishin</a><br>

<a href="http://twitter.com/michaelklishin" target="_blank">http://twitter.com/michaelklishin</a><br><br>