<div><br></div><div><span style="color: rgb(160, 160, 168); ">On Monday, August 6, 2012 at 10:29 AM, RaphaĆ«l De Giusti wrote:</span></div>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div>Hi everyone,<div><br></div><div>I'm interested in running pika's IOLoop in a thread and I came across this code sample :&nbsp;<a href="http://cms02.phys.ntu.edu.tw/tracs/env/browser/trunk/messaging/pika/mon.py">http://cms02.phys.ntu.edu.tw/tracs/env/browser/trunk/messaging/pika/mon.py</a></div><div><br></div><div>I was wondering why and what could be the advantages of wrapping the callbacks in methods (I can understand the&nbsp;on_exchange_declared() method that returns a different callback according to thread's name) ?</div></div></div></span></blockquote><div>As opposed to doing lambda's for callbacks? I'm not sure of the context of what you're comparing callback passing style to.</div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><span><div><div><div>Another question is why considering multiprocessing over threading in this case ?</div></div></div></span></blockquote><div>The IOLoop is a singleton instance and you will run into contention issues and non-thread safe behaviors in use of the IOLoop and event processing.&nbsp;</div><div><br></div><div>I'm not sure what threading buys you in an asynchronous event based model of processing but needless complexity.</div><div><br></div><div>Gavin</div><div><br>
                </div>