connect() public method

Connect to Disque
public connect ( ) : Disque\Connection\Node\Node
return Disque\Connection\Node\Node Connected node information
Ejemplo n.º 1
0
 /**
  * @param array $options
  * @return array
  * @throws
  */
 public function connect($options = [])
 {
     if (!$this->autoconnect) {
         return $this->disque->connect($options);
     } else {
         throw new \Exception('Connection already established via autoconnect, no need to call connect()');
     }
 }
Ejemplo n.º 2
0
 /**
  * Check that we are connected to a node, and if not connect
  *
  * @throws Disque\Connection\ConnectionException
  */
 private function checkConnected()
 {
     if (!$this->client->isConnected()) {
         $this->client->connect();
     }
 }