title: Log error in PHP-AMQPLib if no message confirmation is received in 10 seconds
body: <p>I'd like my RabbitMQ application to wait for publisher confirmation before assuming the message as published. This can be achieved by setting the channel to confirm mode and then waiting for pending messages to be acknowledged.</p>
  
  <p><strong>What if I want to define a custom timeout (eg. 10 seconds), and after the time has passed the application should print an error message in case there are unconfirmed messages left.</strong></p>
  
  <p>Using <a href="https://github.com/php-amqplib/php-amqplib" rel="nofollow noreferrer">PHPAMQPLib</a> v2.6.2 where I have so far tried to implement this logic in the <em>nack handler</em> via <code>$this-&gt;channel-&gt;set_nack_handler($callBack)</code> where <code>$callBack</code> is a function handling the error logging. The thing is I can't tell whether this approach works or not.</p>
  
  <p>In the class initialization method I have:</p>
  
  <p><code>$this-&gt;channel-&gt;confirm_select();</code></p>
  
  <p>In the method that handles message publishing I have:</p>
  
  <p><code>$this-&gt;channel-&gt;wait_for_pending_acks(static::CONFIRM_TIMEOUT);</code></p>
  
  <p>Above constant <code>CONFIRM_TIMEOUT</code> is set to 10 seconds.</p>