Hello everyone,<div><br></div><div>I&#39;m in a situation where I need to create a lot of queues, let&#39;s say 20, using Pika 0.9.5.</div><div>I&#39;m currently using the SelectConnection module which works with callbacks.</div>
<div><br></div><div>I don&#39;t want to cascade 20 consecutive callbacks to achieve this:</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
def on_channel_open(channel_):<br>    global channel<br>    channel = channel_<br>    channel.queue_declare(queue=&quot;queue1&quot;, durable=True,<br>                              exclusive=False, auto_delete=False,<br>                              callback=on_queue_1_declared)<br>
def on_queue_1_declared(frame):<br>    channel.queue_declare(queue=&quot;queue2&quot;, durable=True,<br>                              exclusive=False, auto_delete=False,<br>                              callback=on_queue_2_declared)<br>
def on_queue_2_declared(frame):<br>    channel.queue_declare(queue=&quot;queue3&quot;, durable=True,<br>                              exclusive=False, auto_delete=False,<br>                              callback=on_queue_3_declared)<br>
def on_queue_3_declared(frame):<br>    channel.queue_declare(queue=&quot;queue4&quot;, durable=True,<br>                              exclusive=False, auto_delete=False,<br>                              callback=on_queue_4_declared) </blockquote>
</div><div><br></div><div>And so on...</div><div><br></div><div>This is not pretty. Any idea on how to achieve this without declaring all those callbacks ?</div><div><br></div><div><br></div><div><br></div>