예제 #1
0
 public function updateStatus(X_Threads_Thread_Info $thread, $state, $info)
 {
     // store info in shared memory
     $this->storeStatus($thread->getId(), $state, $info);
     // update the thread
     $thread->setStatus($state, $info);
 }
예제 #2
0
 public function showQueue(X_Threads_Thread_Info $thread)
 {
     $queue = $this->getZendQueue($thread->getId());
     $received = $queue->receive(25, 0);
     $messages = array();
     foreach ($received as $message) {
         /* @var $message Zend_Queue_Message */
         $messages[] = @unserialize($message->body);
     }
     return $messages;
 }
예제 #3
0
 /**
  * Spawn a new thread
  * 
  * @param X_Threads_Thread_Info $thread
  */
 protected function resume(X_Threads_Thread_Info $thread)
 {
     if (!$this->getStarter()->spawn($thread->getId())) {
         throw new Exception("Thread not started {{$thread->getId()}");
     }
 }