/var/www/vhosts/nabawater/vendor/mikemadisonweb/yii2-rabbitmq/components
Edit: /var/www/vhosts/nabawater/vendor/mikemadisonweb/yii2-rabbitmq/components/BaseConsumer.php (3303B)
callback = $callback;
}
public function stopConsuming()
{
$this->getChannel()->basic_cancel($this->getConsumerTag(), false, true);
}
protected function maybeStopConsumer()
{
if (extension_loaded('pcntl') && (defined('AMQP_WITHOUT_SIGNALS') ? !AMQP_WITHOUT_SIGNALS : true)) {
if (!function_exists('pcntl_signal_dispatch')) {
throw new \BadFunctionCallException("Function 'pcntl_signal_dispatch' is referenced in the php.ini 'disable_functions' and can't be called.");
}
pcntl_signal_dispatch();
}
if ($this->forceStop || ($this->consumed == $this->target && $this->target > 0)) {
$this->stopConsuming();
} else {
return;
}
}
/**
* @param $tag
*/
public function setConsumerTag($tag)
{
$this->consumerTag = $tag;
}
public function getConsumerTag()
{
return $this->consumerTag;
}
public function forceStopConsumer()
{
$this->forceStop = true;
}
/**
* Sets the qos settings for the current channel
* Consider that prefetchSize and global do not work with rabbitMQ version <= 8.0
*
* @param int $prefetchSize
* @param int $prefetchCount
* @param bool $global
*/
public function setQosOptions($prefetchSize = 0, $prefetchCount = 0, $global = false)
{
$this->getChannel()->basic_qos($prefetchSize, $prefetchCount, $global);
}
/**
* @param $idleTimeout
*/
public function setIdleTimeout($idleTimeout)
{
$this->idleTimeout = $idleTimeout;
}
/**
* Set exit code to be returned when there is a timeout exception
*
* @param int|null $idleTimeoutExitCode
*/
public function setIdleTimeoutExitCode($idleTimeoutExitCode)
{
$this->idleTimeoutExitCode = $idleTimeoutExitCode;
}
public function getIdleTimeout()
{
return $this->idleTimeout;
}
/**
* Get exit code to be returned when there is a timeout exception
*
* @return int|null
*/
public function getIdleTimeoutExitCode()
{
return $this->idleTimeoutExitCode;
}
/**
* Resets the consumed property.
* Use when you want to call start() or consume() multiple times.
*/
public function resetConsumed()
{
$this->consumed = 0;
}
protected function startConsuming()
{
if ($this->autoSetupFabric) {
$this->setupFabric();
}
$this->getChannel()->basic_consume($this->queueOptions['name'], $this->getConsumerTag(), false, false, false, false, [$this, 'processMessage']);
}
}