示例#1
0
 protected function setupPullSocket($queueId)
 {
     $connect = true;
     if (!empty($this->pull)) {
         $endpoints = $this->pull->getendpoints();
         if (!empty($endpoints["bind"][0]) && $endpoints["bind"][0] != $queueId) {
             $this->pull->unbind($endpoints["bind"][0]);
         } else {
             $connect = false;
         }
     } else {
         $this->pull = $this->socketFactory->createPullSocket();
     }
     if ($connect) {
         $this->pull->bind($queueId);
     }
 }