Пример #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()}");
     }
 }