/** * @return DispatcherZmq */ protected function _handleRequest() { $result = $this; if (!$this->hasCurrentRequestText()) { return $result; } $requestText = $this->getCurrentRequestText(); $startTS = microtime(true); $this->unsetGateway(); $gateway = $this->getGateway(); $gateway->init(); $gateway->setIsAutoEmitResponseEnabled(false); $gateway->setIsAutoFetchRequestTextEnabled(false); $gateway->setIsDebugEnabled($this->getIsDebugEnabled()); $requestData = RpcUtil::jsonDecode($requestText, true, false); $gateway->setRawRequestData($requestData); $gateway->run(); $stopTS = microtime(true); $durationTS = $stopTS - $startTS; $responseText = $gateway->getRawResponseText(); echo PHP_EOL . " ==== GATEWAY RESPONSE:BEGIN ===" . PHP_EOL; echo $responseText; echo PHP_EOL . " ==== GATEWAY RESPONSE:END ===" . PHP_EOL; echo PHP_EOL . " ==== GATEWAY PROFILER:BEGIN ===" . PHP_EOL; var_dump(array('duration' => $durationTS)); echo PHP_EOL . " ==== GATEWAY PROFILER:END ===" . PHP_EOL; return $result; }
/** * @return GatewayModule */ protected function _rawRequestDecode() { if ($this->getIsAutoFetchRequestTextEnabled()) { $requestText = (string) $this->_rawRequestFetchText(); $this->_rawRequestText = $requestText; $requestData = RpcUtil::jsonDecode($requestText, true, false); if (!is_array($requestData)) { $requestData = array(); } $this->_rawRequestData = $requestData; } return $this; }