Created
October 23, 2012 13:25
-
-
Save FrancisVarga/3938717 to your computer and use it in GitHub Desktop.
Zend RPC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\JsonRpc\V1\ZeroMq; | |
class Request extends \Processus\Abstracts\JsonRpc\AbstractJsonRpcRequest | |
{ | |
public function __construct() | |
{ | |
} | |
/** | |
* @return Request | |
*/ | |
public function init() | |
{ | |
list ($this->_domain, $this->_class, $this->_method) = explode('.', | |
parent::getMethod()); | |
return $this; | |
} | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: hippsterkiller | |
* Date: 10/23/12 | |
* Time: 3:06 PM | |
* To change this template use File | Settings | File Templates. | |
*/ | |
$processusCorePath = '../library/Processus/core/'; | |
$applicationPath = '../application/php/Application/'; | |
require_once($processusCorePath . 'Interfaces/InterfaceBootstrap.php'); | |
require_once($processusCorePath . 'Interfaces/InterfaceApplicationContext.php'); | |
require_once ($processusCorePath . 'ProcessusBootstrap.php'); | |
require_once($applicationPath . 'ApplicationBootstrap.php'); | |
$startTime = microtime(true); | |
echo "" . $startTime . PHP_EOL; | |
$rawRequest = array( | |
"method" => "App.TestZendRpc.foobar", | |
"params" => array(), | |
"id" => 1 | |
); | |
$bootstrap = \Application\ApplicationBootstrap::getInstance(); | |
$bootstrap->init(); | |
for ($i = 0; $i <= 1000; $i++) { | |
$request = new \Application\JsonRpc\V1\App\Request(); | |
$request->loadJson(json_encode($rawRequest)); | |
$request->init(); | |
$gtw = new \Application\JsonRpc\V1\App\Gateway(); | |
$gtw->setRequest($request); | |
$gtw->run(); | |
} | |
$endTime = microtime(true); | |
$duration = $endTime - $startTime; | |
var_dump($duration); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment