$this->ConsumeQName
@return void
3463
private function ConsumeQName()
	{
		$c;
		$sb = array();
		$this->BeginToken();
		while ( ( $c = $this->Peek( 0 ) ) && ord( $c ) != 0 && preg_match( "/^[\p{L}\p{N}_\-.:]/u", $c ) )
		{
			$sb[] = $this->Read();
		}
		$this->EndToken();
		$this->ConsumeToken2( Token::QName, implode( "", $sb ) );
	}
830791
public static function checkBrowserQQ(){
		if (stripos(self::$userAgentString, 'QQBrowser') !== false) {
			$aresult = explode('/', stristr(self::$userAgentString, 'QQBrowser') );
			if (isset($aresult[1])) {
				$aversion = explode(' ', $aresult[1]);
				self::$browser->setVersion($aversion[0]);
			}
			self::$browser->setName(Browser::QQ);
			return true;
		}

		return false;
	}
1070127
public function observe()
  {
    if ( $this->check() ){
      $sql = <<<MYSQL
  SELECT o.id, o.id_user, o.request, o.params,
  GROUP_CONCAT(HEX(aliases.id) SEPARATOR ',') AS aliases,
  GROUP_CONCAT(HEX(aliases.id_user) SEPARATOR ',') AS users,
  GROUP_CONCAT(aliases.result SEPARATOR ',') AS results
  FROM bbn_observers AS o
    LEFT JOIN bbn_observers AS aliases
      ON aliases.id_alias = o.id
  WHERE o.id_alias IS NULL
  AND o.next < NOW()
  GROUP BY o.id
  HAVING COUNT(aliases.id) > 0
  OR o.id_user IS NOT NULL
MYSQL;

      $diff = [];
      //MAX: 2000
      $this->db->query('SET @@group_concat_max_len = ?', 2000 * 32);
      foreach ( $this->db->get_rows($sql) as $d ){
        $aliases = $d['aliases'] ? array_map('strtolower', explode(',', $d['aliases'])) : [];
        $users = $d['users'] ? array_map('strtolower', explode(',', $d['users'])) : [];
        $results = $d['results'] ? explode(',', $d['results']) : [];
        if ( \bbn\str::is_json($d['request']) ){
          $d['request'] = json_decode($d['request'], true);
          $real_result = $this->_exec_array($d['request']);
        }
        else{
          $real_result = $this->_exec($d['request'], $d['params']);
        }
        $db_result = $this->get_result($d['id']);
        // Only if users are attached to the
        echo '+';
        if ( $real_result !== $db_result ){
          $this->db->update('bbn_observers', ['result' => $real_result], ['id' => $d['id']]);
          if ( $d['id_user'] ){
            if ( !isset($diff[$d['id_user']]) ){
              $diff[$d['id_user']] = [];
            }
            $diff[$d['id_user']][] = [
              'id' => $d['id'],
              'result' => $real_result
            ];
          }
        }
        foreach ( $aliases as $i => $a ){
          if ( $real_result !== $results[$i] ){
            $this->db->update('bbn_observers', ['result' => $real_result], ['id' => $a]);
            $t = $users[$i];
            if ( !isset($diff[$t]) ){
              $diff[$t] = [];
            }
            $diff[$t][] = [
              'id' => $a,
              'result' => $real_result
            ];
          }
        }
        bbn\x::log(['-------------------', $d, $diff], 'error');
        $this->_update_next($d['id']);
      }
      echo '.';
      $this->db->flush();
      if ( count($diff) ){
        bbn\x::dump('Returning diff!', $diff);
        return $diff;
      }
      if ( ob_get_contents() ){
        ob_end_flush();
      }
      return true;
    }
    bbn\x::dump('Canceling observer: '.date('H:i:s Y-m-d'));
    return false;
  }
256706
public function loadDefaults()
  {
    $this->addSe('*.google.*', 'q');
    $this->addSe('*.yahoo.*', 'p');
    $this->addSe('*.live.*', 'q');
    $this->addSe('*.bing.*', 'q');
    $this->addSe('*.aolsvc.*', 'q');
    $this->addSe('suche.webfan.de', 'q');
  }
987089
private function actionQueue() {
        $this->match(Token::T_ACTION);

        $action = ltrim($this->lastToken->getText(), '@');

        $this->match(Token::T_LEFT_PARENTHESIS);
        $this->match(Token::T_ID);
        $value = $this->lastToken->getText();
        $this->match(Token::T_RIGHT_PARENTHESIS);

        $this->metadata->addMetadata($action, $value);

        if (!$this->lookahead->isAnnotation()) {
            $this->lexer->gotoNextAnnotation();
            $this->consume();
        }
    }
511788
public function feed()
    {
        common_Logger::t('Evaluating AsyncFile ' . $this->getName(), array(
            'TAO'));
        if (isset($_POST[$this->name])) {
            $struct = json_decode($_POST[$this->name], true);
            if ($struct !== false) {
                $this->setValue($struct);
            } else {
                common_Logger::w('Could not unserialise AsyncFile field ' . $this->getName(), array(
                    'TAO'));
            }
        }
    }
597761
protected function consumeData() {
        // Character Ref
        /*
         * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData();
         */
        $this->characterReference();
        $this->tagOpen();
        $this->eof();
        $this->characterData();

        return $this->carryOn;
    }
146025
public function loadConfiguration(): void
	{
		parent::loadConfiguration();

		$builder = $this->getContainerBuilder();

		$builder->addDefinition($this->prefix('application'))
			->setFactory(MiddlewareApplication::class)
			->setArguments([new Statement('@' . $this->prefix('chain') . '::create')]);
	}
556929
public function feed()
    {
        $expression = "/^" . preg_quote($this->name, "/") . "(.)*[0-9]+$/";
        $this->setValues(array());
        foreach ($_POST as $key => $value) {
            if (preg_match($expression, $key)) {
                $this->addValue(tao_helpers_Uri::decode($value));
            }
        }
    }
1264972
protected function registerCouchbaseQueueDriver(): void
    {
        /** @var QueueManager $queueManager */
        $queueManager = $this->app['queue'];
        $queueManager->addConnector('couchbase', function () {
            /** @var DatabaseManager $databaseManager */
            $databaseManager = $this->app['db'];

            return new QueueConnector($databaseManager);
        });
    }
554091
def consume(self, on_message, queue):
        
        self.channel.queue_declare(queue=queue, durable=True, exclusive=False,
                                   auto_delete=False)
        self.channel.queue_bind(queue=queue, exchange=self._exchange,
                                routing_key=self._routing_key)
        self.channel.basic_qos(prefetch_count=1)
        # Setup up our consumer callback
        self.channel.basic_consume(on_message, queue)
        # This is blocking until channel.stop_consuming is called
        # and will allow us to receive messages
        self.channel.start_consuming()
1361058
public function consumeAction()
    {
        $this->checkCartNotEmpty();

        $message = false;
        $couponCodeForm = $this->createForm(FrontForm::COUPON_CONSUME);

        try {
            $form = $this->validateForm($couponCodeForm, 'post');

            $couponCode = $form->get('coupon-code')->getData();

            if (null === $couponCode || empty($couponCode)) {
                $message = true;
                throw new \Exception(
                    $this->getTranslator()->trans(
                        'Coupon code can\'t be empty',
                        [],
                        Front::MESSAGE_DOMAIN
                    )
                );
            }

            $couponConsumeEvent = new CouponConsumeEvent($couponCode);

            // Dispatch Event to the Action
            $this->getDispatcher()->dispatch(TheliaEvents::COUPON_CONSUME, $couponConsumeEvent);

            /* recalculate postage amount */
            $order = $this->getSession()->getOrder();

            if (null !== $order) {
                $deliveryModule = $order->getModuleRelatedByDeliveryModuleId();
                $deliveryAddress = AddressQuery::create()->findPk($order->getChoosenDeliveryAddress());

                if (null !== $deliveryModule && null !== $deliveryAddress) {
                    $moduleInstance = $deliveryModule->getDeliveryModuleInstance($this->container);

                    $orderEvent = new OrderEvent($order);

                    try {
                        $deliveryPostageEvent = new DeliveryPostageEvent(
                            $moduleInstance,
                            $this->getSession()->getSessionCart($this->getDispatcher()),
                            $deliveryAddress
                        );

                        $this->getDispatcher()->dispatch(
                            TheliaEvents::MODULE_DELIVERY_GET_POSTAGE,
                            $deliveryPostageEvent
                        );

                        $postage = $deliveryPostageEvent->getPostage();

                        $orderEvent->setPostage($postage->getAmount());
                        $orderEvent->setPostageTax($postage->getAmountTax());
                        $orderEvent->setPostageTaxRuleTitle($postage->getTaxRuleTitle());

                        $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent);
                    } catch (\Exception $ex) {
                        // The postage has been chosen, but changes dues to coupon causes an exception.
                        // Reset the postage data in the order
                        $orderEvent->setDeliveryModule(0);

                        $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_MODULE, $orderEvent);
                    }
                }
            }

            return $this->generateSuccessRedirect($couponCodeForm);
        } catch (FormValidationException $e) {
            $message = $this->getTranslator()->trans(
                'Please check your coupon code: %message',
                ["%message" => $e->getMessage()],
                Front::MESSAGE_DOMAIN
            );
        } catch (UnmatchableConditionException $e) {
            $message = $this->getTranslator()->trans(
                'You should <a href="%sign">sign in</a> or <a href="%register">register</a> to use this coupon',
                [
                    '%sign' => $this->retrieveUrlFromRouteId('customer.login.view'),
                    '%register' => $this->retrieveUrlFromRouteId('customer.create.view'),
                ],
                Front::MESSAGE_DOMAIN
            );
        } catch (PropelException $e) {
            $this->getParserContext()->setGeneralError($e->getMessage());
        } catch (\Exception $e) {
            $message = $this->getTranslator()->trans(
                'Sorry, an error occurred: %message',
                ["%message" => $e->getMessage()],
                Front::MESSAGE_DOMAIN
            );
        }

        if ($message !== false) {
            Tlog::getInstance()->error(
                sprintf("Error during order delivery process : %s. Exception was %s", $message, $e->getMessage())
            );

            $couponCodeForm->setErrorMessage($message);

            $this->getParserContext()
                ->addForm($couponCodeForm)
                ->setGeneralError($message);
        }

        return $this->generateErrorRedirect($couponCodeForm);
    }
349439
public function processQueues()
    {
        // consume queues for each store with a unique set of AMQP configuration
        foreach ($this->_amqpConfigHelper->getQueueConfigurationScopes() as $store) {
	    $this->_store = $store;
            $this->_consumeStoreQueues($store);
        }
        return $this;
    }
128763
public function createQueue($queueName)
    {
        if ($this->queueExists($queueName)) {
            return;
        }

        $parameters = [
            'QueueName' => $queueName,
        ];

        if ($this->isFifoQueue($queueName)) {
            $parameters['Attributes'] = [
                'FifoQueue' => 'true',
            ];
        }

        $result = $this->sqs->createQueue($parameters);

        $this->queueUrls[$queueName] = $result['QueueUrl'];
    }
580006
public function run()
    {
        foreach ($this->pubsub as $message) {
            $kind = $message->kind;

            if ($kind !== Consumer::MESSAGE && $kind !== Consumer::PMESSAGE) {
                if (isset($this->subscriptionCallback)) {
                    $callback = $this->subscriptionCallback;
                    call_user_func($callback, $message);
                }

                continue;
            }

            if (isset($this->callbacks[$message->channel])) {
                $callback = $this->callbacks[$message->channel];
                call_user_func($callback, $message->payload);
            } elseif (isset($this->defaultCallback)) {
                $callback = $this->defaultCallback;
                call_user_func($callback, $message);
            }
        }
    }
491681
public function init()
    {
        $this->db = \PHPDaemon\Clients\Mongo\Pool::getInstance($this->config->mongoclientname->value);
        $this->cache = \PHPDaemon\Clients\Memcache\Pool::getInstance($this->config->memcacheclientname->value);
        if (!isset($this->config->limitinstances)) {
            $this->log('missing \'limitInstances\' directive');
        }
    }
68747
protected function setQuery()
    {
        $this->builder = $this->connection->createQueryBuilder();
        $this->builder->delete($this->connection->quoteIdentifier($this->model->table()));
    }