Exemplo n.º 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->subscribe($this->_subscription['deliveryMode']['address'], array($this, 'notify'));
     return $this;
 }
Exemplo n.º 2
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;
 }
 protected function subscribeAtPubnub()
 {
     if (!$this->isSubscribed()) {
         return $this;
     }
     $this->pubnub = $this->pubnubFactory->getPubnub(array('publish_key' => 'convince-pubnub-its-okay', 'subscribe_key' => $this->subscription['deliveryMode']['subscriberKey']));
     //print 'PUBNUB object created' . PHP_EOL;
     $this->pubnub->subscribe($this->subscription['deliveryMode']['address'], array($this, 'notify'));
     //print 'PUBNUB subscription created' . PHP_EOL;
     return $this;
 }