示例#1
0
 public function launch()
 {
     if (!empty($this->config['webhook_url'])) {
         $this->rabbitmq->consume($this->config['rabbit_outgoing_queue'], array($this, 'outgoing'));
     }
     if (!empty($this->config['rabbit_incoming_queue'])) {
         $this->rabbitmq->consume($this->config['rabbit_incoming_queue'], array($this, 'incoming'));
     }
     try {
         $this->rabbitmq->waitLoop();
     } catch (AMQPRuntimeException $amqprre) {
         echo "AMQPRuntimeException:" . $amqprre->getMessage() . "\n";
     }
 }