Hello everyone,<div><br></div><div>I'm in a situation where I need to create a lot of queues, let's say 20, using Pika 0.9.5.</div><div>I'm currently using the SelectConnection module which works with callbacks.</div>
<div><br></div><div>I don'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="queue1", 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="queue2", 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="queue3", 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="queue4", 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>