Ejemplo n.º 1
0
 function __construct($params)
 {
     $exchange = 'celery';
     $binding = 'celery';
     $port = 5672;
     $host = $params['host'];
     $login = $params['login'];
     $password = $params['password'];
     $vhost = $params['vhost'];
     if (!class_exists('AMQPConnection')) {
         throw new CeleryException("Class AMQPConnection not found\nMake sure that AMQP extension is installed and enabled:\nhttp://www.php.net/manual/en/amqp.installation.php");
     }
     foreach (array('host', 'login', 'password', 'vhost', 'exchange', 'binding', 'port') as $detail) {
         $this->connection_details[$detail] = ${$detail};
     }
     $this->connection = Celery::InitializeAMQPConnection($this->connection_details);
     #$success = $this->connection->connect();
 }
Ejemplo n.º 2
0
 function __wakeup()
 {
     if ($this->connection_details) {
         $this->connection = Celery::InitializeAMQPConnection($this->connection_details);
     }
 }