Requests the queue status.

@param string $manager

@return array
@throws \RuntimeException
557761
public function queueStatus($manager)
    {
        $socket = $this->getSocket($manager);
        $stream = $socket->getStream();

        $stream->send(new QueueStatusRequest());

        $msg = $stream->read(new TimeoutTimer(1500));
        if (!$msg instanceof QueueStatusResponse) {
            throw new RuntimeException('Invalid response: '.get_class($msg).'.');
        }

        return $msg->getQueueStatus();
    }
660136
public function getRequest()
    {
        if ($this->hasRequest() === false) {
            // Try to get request from container.
            $this->setRequest($this->getContainer()->get('request_stack')->getCurrentRequest());
        }

        if ($this->hasRequest() === false) {
            throw new \RuntimeException("Sorry, the request is not available in this context");
        }

        return $this->request;
    }
621419
private function getRequest()
    {
        if ($this->requestStack instanceof Request) {
            $request = $this->requestStack;
        } elseif ($this->requestStack instanceof RequestStack) {
            $request = $this->requestStack->getCurrentRequest();
        }

        if ($request !== null) {
            return $request;
        }

        throw new \RuntimeException('There is no current request.');
    }
213791
protected function getRequestsNotRunning()
    {
        $map = $this->queue;
        foreach ($this->running as $k => $v) unset($map[$k]);
        return $map;
    }
133083
protected function retrieveNextJob($queue)
    {
        if (!is_null($this->blockFor)) {
            return $this->blockingPop($queue);
        }

        $job      = $this->redis->lpop($queue);
        $reserved = false;

        if ($job) {
            $reserved = json_decode($job);
            $reserved['attempts']++;
            $reserved = json_encode($reserved);
            $this->redis->zAdd($queue . ':reserved', $this->availableAt($this->retryAfter), $reserved);
        }

        return [$job, $reserved];
    }
347117
public function getMessageQueue()
	{
		// For empty queue, if messages exists in the session, enqueue them.
		if (!count($this->_messageQueue))
		{
			$session = JFactory::getSession();
			$sessionQueue = $session->get('application.queue');

			if (count($sessionQueue))
			{
				$this->_messageQueue = $sessionQueue;
				$session->set('application.queue', null);
			}
		}

		return $this->_messageQueue;
	}
191761
protected function createDefaultArgs(Manager $manager)
    {
        if (!$this->queryFilter->exists()) {
            return [];
        }
        return [
            self::FILTER => [
                'type' => $manager->getType($this->inputTypeName(self::FILTER)),
            ],
            self::EXCLUDE => [
                'type' => $manager->getType($this->inputTypeName(self::EXCLUDE)),
            ],
        ];
    }
1261818
public function load(ObjectManager $manager, FixtureInterface $fixture)
    {
        if ($this->logger) {
            $prefix = '';
            if ($fixture instanceof OrderedFixtureInterface) {
                $prefix = sprintf('[%d] ',$fixture->getOrder());
            }
            $this->log('loading ' . $prefix . get_class($fixture));
        }
        // additionally pass the instance of reference repository to shared fixtures
        if ($fixture instanceof SharedFixtureInterface) {
            $fixture->setReferenceRepository($this->referenceRepository);
        }
        $fixture->load($manager);
        $manager->clear();
    }
256472
protected function getRequest()
    {
        if (empty($this->method) || empty($this->host)) {
            throw new \RuntimeException('Attempted to get unspecified Request');
        }

        return new Request(
            $this->method,
            $this->host . $this->resource,
            $this->headers,
            $this->body
        );
    }
895811
public function getStatus()
    {
        /** @var $result CallResult */
        $result = $this->getSvn()->{'status'}($this->getRepositoryPath(), array(
            '--xml'
        ));
        $result->assertSuccess(
            sprintf('Cannot retrieve status from "%s"', $this->getRepositoryPath())
        );

        $xml    = simplexml_load_string($result->getStdOut());
        if (!$xml) {
            throw new \RuntimeException(sprintf('Cannot read status XML for "%s"', $this->getRepositoryPath()));
        }

        $status = array();
        foreach ($xml->xpath('/status/target/entry') as $entry) {
            $status[]   = array(
                'file'      => (string)$entry['path'],
                'status'    => (string)$entry->{'wc-status'}['item']
            );
        }
        return $status;
    }
813232
protected function askRequired($message) {
    $question = new Question($this->formatQuestion($message));
    $question->setValidator(function ($answer) {
      if (empty($answer)) {
        throw new \RuntimeException(
          'You must enter a value!'
        );
      }

      return $answer;
    });
    return $this->doAsk($question);
  }
14702
public function getStatus()
    {
        $statusResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl('inputs/status')
        );

        if (isset($statusResult['counts'])) {
            $status = $statusResult['counts'];
        } else {
            throw new \Exception('Status Not Found');
        }

        return $status;
    }
1297241
protected function getApiQueueStatus()
    {
        if (!class_exists(GuzzleClient::class)) {
            throw new \RuntimeException(
                'The guzzle http client library is required to run rabbitmq health checks. '
                .'Make sure to add guzzlehttp/guzzle to your composer.json.'
            );
        }

        $client = new GuzzleClient();
        $client->setConfig(['curl.options' => [CURLOPT_CONNECTTIMEOUT_MS => 3000]]);
        $request = $client->get(sprintf('%s/queues', $this->settings['console_url']));
        $request->setAuth($this->settings['user'], $this->settings['pass']);

        return json_decode($request->send()->getBody(true), true);
    }
441027
public function status($status)
    {
        $httpStatus = (string) $this->response->getStatusCode();
        if (is_array($status) && !in_array($httpStatus, $status)) {
            throw new \RuntimeException(
                "Unexpected response status code: {$httpStatus}"
            );
        }

        if (is_string($status) && $httpStatus !== $status) {
            throw new \RuntimeException(
                "Unexpected response status code: {$httpStatus}"
            );
        }

        return $this;
    }
1108280
public function getStatus() {
        if ($this->pid) {
            $waitPID = \pcntl_waitpid($this->pid, $status, WNOHANG);

            if ($waitPID == $this->pid) {
                return Thread::THREAD_EXITED;
            } else {
                return Thread::THREAD_RUNNING;
            }
        }
    }
287557
public function managerGetRealms()
    {
        $theRealms = [];

        foreach ($this->realmManager->getRealms() as $realm) {
            /* @var $realm \Thruway\Realm */
            $theRealms[] = [
                'name' => $realm->getRealmName()
            ];
        }

        return [$theRealms];
    }
510926
protected function get($request)
    {
        $response = $this->client->get($this->prefix.$this->getLocale().$request)->send();
        if ($response->isError()) {
            throw new \RuntimeException(
                'Failed execute request "'.$request.'" to the server "'.$this->client->getBaseUrl().'"'
            );
        }
        return json_decode($response->getBody(true), true);
    }