示例#1
0
文件: Shared.php 项目: shulard/Worker
 /**
  * Get informations about the shared worker.
  *
  * @return  array
  */
 public function getInformations()
 {
     $this->_client->connect();
     $this->_client->writeAll(Backend\Shared::pack(Backend\Shared::TYPE_INFORMATIONS, ""));
     $this->_client->read(2);
     // skip type.
     $length = unpack('Nl', $this->_client->read(4));
     $message = $this->_client->read($length['l']);
     $this->_client->read(1);
     // skip eom.
     $this->_client->disconnect();
     return unserialize($message);
 }
示例#2
0
文件: Shared.php 项目: haskel/Worker
 /**
  * Stop the shared worker.
  *
  * @return  bool
  */
 public function stop()
 {
     $client = new Socket\Client($this->_socket);
     $client->connect();
     $client->writeAll(static::pack(static::TYPE_STOP, $this->_password));
     $client->disconnect();
     return true;
 }