Esempio n. 1
0
 /**
  * 阻塞的投递信息
  *
  * @param mixed  $taskData
  * @param float  $timeout
  * @param int    $workerId
  * @param int    $serverId
  * @param string $serverGroup
  * @return mixed
  */
 public function taskWait($taskData, $timeout = 0.5, $workerId = -1, $serverId = -1, $serverGroup = null)
 {
     if (Server::$clustersType < 2) {
         # 非高级集群模式
         return $this->server->taskwait($taskData, $timeout, $workerId);
     } else {
         $client = Clusters\Client::getClient($serverGroup, $serverId, $workerId, true);
         if (!$client) {
             return false;
         }
         return $client->taskWait($taskData, $timeout, $this->name);
     }
 }