コード例 #1
0
 protected function subscribeAtPubnub()
 {
     if (!$this->alive()) {
         throw new Exception('Subscription is not alive');
     }
     $this->_pubnub = $this->_pubnubFactory->pubnub(array('publish_key' => 'convince-pubnub-its-okay', 'subscribe_key' => $this->_subscription['deliveryMode']['subscriberKey']));
     $this->_pubnub->setSubscribeTimeout(self::SUBSCRIBE_TIMEOUT);
     $this->_pubnub->subscribe($this->_subscription['deliveryMode']['address'], array($this, 'notify'), 0, false, array($this, 'pubnubTimeoutHandler'));
     return $this;
 }