How to set a timeout on declareQueue

25 views
Skip to first unread message

Gidget Gadget

unread,
Sep 12, 2018, 11:24:45 AM9/12/18
to php-amqplib-devel
I need a way to set a timeout on declareQueue.  When the server is not responding the declareQueue function waits forever.

// Create a channel
$ch
= new AMQPChannel($cnn);
// Create a new queue
$q
= new AMQPQueue($ch);
$q
->setName($queue_name);
$q
->setFlags(AMQP_DURABLE);
echo
"getting counts".PHP_EOL;
$mcount
=$q->declareQueue();
echo
"count: {$mcount}".PHP_EOL;

Is there a way to timeout after x seconds?
Reply all
Reply to author
Forward
0 new messages