Execute the calls in queue and return the result
@return mixed[]
185848
function executeMulticall()
    {
        $responses = $this->xmlrpcClient->multiquery();
        foreach ($responses as $i => &$response) {
            if (!($response instanceof Xmlrpc\FaultException) && is_callable($this->multicallHandlers[$i])) {
                $response = call_user_func($this->multicallHandlers[$i], $response);
            }
        }
        $this->multicallHandlers = array();
        return $responses;
    }
72816
public static function getQueuesStats()
    {
        $queuesStats = [];
        foreach (static::$producers as $appId => $producer) {
            /** @var $producer Producer */
            $queuesStats[$appId] = $producer->getQueue()->getStats();
        }

        return $queuesStats;
    }
754455
public function execute(){
		$result = array();
		if(HookProvider::getInstance()->isModuleOperational()){
			$params = func_get_args();
			$sqlquery = '';
			$sqlparams = array($this->hook_function);
			if($this->hook_context != 'all') {
				$sqlparams = array($this->hook_function, $this->hook_context);
				$sqlquery = " OR majh_hook_context=?";
			}
			$module_names=Database::prepare(
					"SELECT majh_module_name AS module, majh_module_priority AS priority FROM `##maj_hooks`".
					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'".
					" ORDER BY majh_module_priority ASC, module ASC"
			)->execute($sqlparams)->fetchAssoc();
			asort($module_names);
			array_unshift($params, array_keys($module_names));
			$result = call_user_func_array(array(&$this, 'executeOnlyFor'), $params);
		}
		return $result;
	}
573961
public function reserve()
    {
        foreach ($this->queues as $queue) {
            $this->getLogger()->debug(
                'Checking {queue} for jobs',
                array(
                    'queue' => $queue
                )
            );
            $job = $queue->dequeue();
            if (false === (null === $job)) {
                $this->getLogger()->info(
                    'Found job {job} on queue {queue}',
                    array(
                        'job' => $job,
                        'queue' => $queue,
                    )
                );

                return $job;
            }
        }

        return null;
    }
377883
public function queue()
    {
        $log = $this->getLogger();
        $log->info('Queueing operation started', array('collections' => count($this)));

        $event = new CollectorEvent($this);
        $this->dispatchEvent(SearchEvents::COLLECTOR_PRE_QUEUE, $event);

        $num_queued = 0;
        foreach ($this->_collections as $collection) {
            $num_queued += $this->queueCollection($collection);
        }

        $this->dispatchEvent(SearchEvents::COLLECTOR_POST_QUEUE, $event);

        $log->info('Queueing operation completed', array('queued' => $num_queued));
        return $num_queued;
    }
613180
public function getResults()
    {
        if (empty($this->results)) {
            $this->results = $this->stmt->fetchAll();
        }

        return $this->results;
    }
1304382
public function execute()
    {
        $pipeline = array_reduce(
            array_reverse($this->pipes), $this->carry(), function ($passable) {
            return $passable;
        }
        );

        return $pipeline($this->passable);
    }
67974
protected function next()
    {
        $promiseOrValue = array_shift($this->queue);
        $promise = resolve($promiseOrValue);
        $this->cancellationQueue->enqueue($promise);
        return $promise;
    }
148656
public function get(): array
    {
        /**
         * @var $queryObject   \Pecee\Pixie\QueryBuilder\QueryObject
         * @var $executionTime float
         * @var $start         float
         * @var $result        array
         */

        $queryObject = $this->getQuery();
        $this->connection->setLastQuery($queryObject);

        $this->fireEvents(EventHandler::EVENT_BEFORE_SELECT, $queryObject);

        $executionTime = 0;
        $startTime = microtime(true);

        if ($this->pdoStatement === null) {

            [$this->pdoStatement, $executionTime] = $this->statement(
                $queryObject->getSql(),
                $queryObject->getBindings()
            );
        }

        $result = \call_user_func_array([$this->pdoStatement, 'fetchAll'], $this->fetchParameters);
        $this->pdoStatement = null;

        $executionTime += microtime(true) - $startTime;

        $this->fireEvents(EventHandler::EVENT_AFTER_SELECT, $queryObject, [
            'execution_time' => $executionTime,
        ]);

        return $result;
    }
224055
public function getReplies()
    {
        $this->channel
            ->basic_consume(
                $this->queueName,
                $this->queueName,
                false,
                true,
                false,
                false,
                array($this, 'processMessage')
            );

        while (count($this->replies) < $this->requests) {
            $this->channel
                ->wait(null, false, $this->requestTimeout);
        }

        $this->channel
            ->basic_cancel($this->queueName);

        return $this->replies;
    }
650196
public function runQueue()
    {
        $count = 0;
        $statistics = array();
        $queue = $this->getServiceManager()->get(Queue::CONFIG_ID);
        $report = new Report(Report::TYPE_SUCCESS);
        $limit = $this->getLimit();
        foreach ($queue as $task) {
            $subReport = $queue->runTask($task);
            $statistics[$subReport->getType()] = isset($statistics[$subReport->getType()])
            ? $statistics[$subReport->getType()] + 1
            : 1;
            $report->add($subReport);
            $count++;
            if ($limit !== 0 && $count === $limit) {
                break;
            }
        }
        
        if (empty($statistics)) {
            $report = new Report(Report::TYPE_INFO, __('No tasks to run'));
        } else {
            if (isset($statistics[Report::TYPE_ERROR]) || isset($statistics[Report::TYPE_WARNING])) {
                $report->setType(Report::TYPE_WARNING);
            }
            $report->setMessage(__('Ran %s task(s):', array_sum($statistics)));
        }
        return $report;
    }
589525
protected function executeCommand()
    {
        $cmdl = $this->realCommand;

        $this->log('Executing command: ' . $cmdl, $this->logLevel);

        $output = [];
        $return = null;

        if ($this->passthru) {
            passthru($cmdl, $return);
        } else {
            exec($cmdl, $output, $return);
        }

        return [$return, $output];
    }
721061
public function executeJob()
    {
        // If the job's already running, don't try to restart it
        if ($this->getJobStatus() !== 'RUNNING') {
            $queue = $this->markStarted();

            // Prepare the queue for processing
            $this->start($queue);
        } else {
            $queue = $this->getQueueObject();
        }

        try {
            $batchSize = $this->getJobQueueBatchSize() ?: PHP_INT_MAX;

            // Loop over queue batches
            while (($messages = $queue->receive($batchSize)) && $messages->count() > 0) {
                // Run the batch
                $this->executeBatch($messages, $queue);
            }

            // Mark the queue as finished
            $output = $this->finish($queue);

            // Mark the job as completed
            $result = $this->markCompleted(0, $output);
        } catch (\Exception $e) {
            $result = $this->markCompleted(Job::JOB_ERROR_EXCEPTION_GENERAL, $e->getMessage());
            $result->message = $result->result; // needed for progressive library.
        }

        return $result;
    }
333321
public function execute()
	{
		// open a Redis connection and execute the queued commands
		foreach ($this->queue as $command)
		{
			for ($written = 0; $written < strlen($command); $written += $fwrite)
			{
				$fwrite = fwrite($this->connection, substr($command, $written));
				if ($fwrite === false)
				{
					throw new \RedisException('Failed to write entire command to stream');
				}
			}
		}

		// Read in the results from the pipelined commands
		$responses = array();
		for ($i = 0; $i < count($this->queue); $i++)
		{
			$responses[] = $this->readResponse();
		}

		// Clear the queue and return the response
		$this->queue = array();

		if ($this->pipelined)
		{
			$this->pipelined = false;
			return $responses;
		}
		else
		{
			return $responses[0];
		}
	}
262501
final protected function prepareResults()
    {
        $args = func_get_args();
        $array = array_shift($args);

        if (!empty($array)) {
            $result = array();
            foreach ($array as $target) {
                array_push($result, $this->callHydrator($target, $args));
            }

            return $result;
        } else {
            return array();
        }
    }
533361
public function run() {
        $results = [
            $this->simulateDelete(),
            $this->simulateUpdate(),
            $this->simulateCreate()
        ];
        
        return array_search(false, $results, true) === false;
    }
485682
public function get() {
        $num_conns = count($this->queue);
        if ($num_conns < $this->pool_size) {
            try {
                $this->make_conn();
            } catch (NoServerAvailable $e) {
                if ($num_conns == 0)
                    throw $e;
            }
        }
        return array_shift($this->queue);
    }