本文整理汇总了PHP中Normalizer::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Normalizer::run方法的具体用法?PHP Normalizer::run怎么用?PHP Normalizer::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Normalizer
的用法示例。
在下文中一共展示了Normalizer::run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
$this->channel->close();
$this->connection->close();
}
public function run()
{
$this->channel->basic_consume($this->bank_config['queue_name'], '', false, true, false, false, array($this, 'on_response'));
echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
$this->running = true;
while (count($this->channel->callbacks) && $this->running) {
$this->channel->wait();
}
}
public function stop()
{
$this->running = false;
}
function forward_to_aggregator($response, $correlation_id)
{
$connection = new AMQPStreamConnection('localhost', 5672, 'test', 'test');
$channel = $connection->channel();
$channel->queue_declare('aggregator', false, false, false, false);
$msg = new AMQPMessage(json_encode($response), array('correlation_id' => $correlation_id));
$channel->basic_publish($msg, '', 'aggregator');
$channel->close();
$connection->close();
}
}
$bank_config = array('host' => 'datdb.cphbusiness.dk', 'port' => '5672', 'username' => 'student', 'password' => 'cph', 'queue_name' => 'vongrad_cphbusiness_json_1');
$normalizer = new Normalizer($bank_config);
$normalizer->run();