Change client queue counter helper
@param int $queueCounter
5657
protected function changeQueueCount($queueCounter)
    {
        if ($queueCounter < 0) {
            $queueCounter = 0;
        }
        $this->_poolClientQueueCounter = $queueCounter;
        //Automatically change client state to `ClientInterface::CLIENT_POOL_STATE_READY` on empty queue
        if ($this->_poolClientQueueCounter === 0 && $this->_poolClientState === PoolClientInterface::CLIENT_POOL_STATE_BUSY) {
            $this->changeState(PoolClientInterface::CLIENT_POOL_STATE_READY);
        } elseif ($this->_poolClientQueueCounter > 0 && $this->_poolClientState === PoolClientInterface::CLIENT_POOL_STATE_READY) {
            $this->changeState(PoolClientInterface::CLIENT_POOL_STATE_BUSY);
        }
        $this->emit(PoolClientInterface::CLIENT_POOL_EVENT_CHANGE_QUEUE, [$queueCounter]);
    }
794924
public function incrementQueue($queue, $runtime)
    {
        $this->connection()->eval(LuaScripts::updateMetrics(), 2,
            'queue:'.$queue, 'measured_queues', str_replace(',', '.', $runtime)
        );
    }
625145
public function resetCounter () : int
    {
        return $this->_counter = $this->getContainerSize() + ( ($this->isUsingHandler()) ? $this->_DataHandler->countEntitys() : 0 );
    }
1346311
public function countMessages($queueName)
    {
        list(, $messageCount) = $this->getChannel()->queue_declare($queueName, true);

        return $messageCount;
    }
985207
def increment_client_count(self, ofs = 1):
        """"""
        self._uc += ofs
        assert self._uc > -1, "Increments must match decrements, usage counter negative: %i" % self._uc

        if self.client_count() == 0:
            self.release()
            return True
        else:
            return False
771267
protected function setCounter($type, $counter)
	{
		if ($type === 'hotp')
		{
			if ($counter !== 0 && empty($counter))
			{
				throw new \InvalidArgumentException("Counter can't be empty if HOTP is being used");
			}

			$this->parameters .= "&counter=$counter";
		}
	}
68345
public function set_queue($langcodes) {
        if (is_array($langcodes)) {
            $this->queue = $langcodes;
        } else if (!empty($langcodes)) {
            $this->queue = array($langcodes);
        }
    }
112836
public function setQueue($queue, $value)
    {
        // Ensure the value is an array
        if (is_array($value) === false) {
            $value = [$value];
        }

        $this->queues[$queue] = array_merge(
            $this->getQueue($queue), $value
        );
    }
942568
public function getQueueMonitor(): ?Monitor
    {
        if (!$this->hasQueueMonitor()) {
            $this->setQueueMonitor($this->getDefaultQueueMonitor());
        }
        return $this->queueMonitor;
    }
590636
public void updateQueuePointOutputHandler(
    SIBUuid8 newLocalisingMEUuid,
    OutputHandler outputHandler,
    SIBUuid8 existingUuid)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "updateQueuePointOutputHandler",
        new Object[] { newLocalisingMEUuid, outputHandler, existingUuid });

    synchronized(_queuePointOutputHandlers)
    {
      _queuePointOutputHandlers.remove(existingUuid);
      _queuePointOutputHandlers.put(newLocalisingMEUuid, outputHandler);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "updateQueuePointOutputHandler");
  }
216350
protected function setQueue(Queue $queue)
    {
        $this->queue = $queue;
        $this->queue->setProducer($this);

        return $this;
    }
469262
protected function _setCounters()
    {
        $this->loadModel('Comment.Comments');
        $pending = $this->Comments->find()->where(['Comments.status' => 'pending', 'Comments.table_alias' => $this->_manageTable])->count();
        $approved = $this->Comments->find()->where(['Comments.status' => 'approved', 'Comments.table_alias' => $this->_manageTable])->count();
        $spam = $this->Comments->find()->where(['Comments.status' => 'spam', 'Comments.table_alias' => $this->_manageTable])->count();
        $trash = $this->Comments->find()->where(['Comments.status' => 'trash', 'Comments.table_alias' => $this->_manageTable])->count();
        $this->set('pendingCounter', $pending);
        $this->set('approvedCounter', $approved);
        $this->set('spamCounter', $spam);
        $this->set('trashCounter', $trash);
    }
596794
public function changeUserNick(UserEventInterface $event, EventQueueInterface $queue)
    {
        $logger = $this->getLogger();

        $connectionMask = $this->getConnectionMask($event->getConnection());
        $old = $event->getNick();
        $params = $event->getParams();
        $new = $params['nickname'];
        $logger->debug('Changing user nick', array(
            'connectionMask' => $connectionMask,
            'oldNick' => $old,
            'newNick' => $new,
        ));

        foreach (array_keys($this->modes[$connectionMask]) as $channel) {
            if (!isset($this->modes[$connectionMask][$channel][$old])) {
                continue;
            }
            $logger->debug('Moving user mode data', array(
                'connectionMask' => $connectionMask,
                'channel' => $channel,
                'oldNick' => $old,
                'newNick' => $new,
            ));
            $this->modes[$connectionMask][$channel][$new] = $this->modes[$connectionMask][$channel][$old];
            unset($this->modes[$connectionMask][$channel][$old]);
        }
    }
1233304
@Override
    public void resetPMICounters() {
        // TODO needs to change if cache provider supports PMI counters.
        final String methodName = "resetPMICounters()";
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + " cacheName=" + cacheName);
        }
    }
379274
public function call(): int
    {
        $count = 0;

        while (!$this->queue->isEmpty() && (0 === $this->maxDepth || $count < $this->maxDepth)) {
            list($callback, $args) = $this->queue->shift();
            ++$count;

            if (empty($args)) {
                $callback();
            } else {
                call_user_func_array($callback, $args);
            }
        }

        return $count;
    }
132715
public function setCpuCount(int $cpuCount)
    {
        $this->cpuCount = $cpuCount;

        $this->hostConfig = array_merge($this->hostConfig, ['CpuCount' => $cpuCount]);

        return $this;
    }
964908
public function change() {
		if ($this->table('queue_processes')->hasIndex(['pid'], ['unique' => true])) {
			$this->table('queue_processes')
				->removeIndex(['pid'], ['unique' => true])
				->save();
		}

		$this->table('queue_processes')
			->addIndex(['pid', 'server'], ['unique' => true])
			->save();
	}